Power BI, Line Chart with Base Value 100

306 views Asked by At

I need to build a line chart that is supposed to show the cumulative increase from Day 1 to the End.

An Example would be like this:

Date  Capital  Value

31-Jan  237  100.00
28-Feb  250  105.48
31-Mar  210   88.60
30-Apr  300  126.58

In other words, is dividing every value by the first value, not of the whole table but the dates that are been displayed in the chart. The first date is dynamically changed as time passes, making it impossible to fix the formula to 31-Jan for example

Kind Regards

1

There are 1 answers

0
Peter On

Try this measure:

% Capital running total in Date =
VAR runtotal =
    CALCULATE (
        SUM ( 'YourTable'[Capital] ),
        FILTER (
            ALLSELECTED ( 'YourTable'[Date] ),
            ISONORAFTER ( 'YourTable'[Date], MAX ( 'YourTable'[Date] ), DESC )
        )
    )
VAR baseval =
    CALCULATE (
        SUM ( 'YourTable'[Capital] ),
        FIRSTDATE ( ALL ( YourTable[Date] ) )
    )
RETURN
    DIVIDE ( runtotal, baseval )

Note that for calculating the Running Total Power BI can help you with a Quick Measure.

enter image description here