Forum Discussion

brunoguedes's avatar
brunoguedes
Frequent Visitor
9 years ago
Solved

Calculate absolute profitability

    Hello, I'm new to power bi and my English sucks. I need a lot of help. I need to calculate the absolute profitability of a column with several values that are modified by the date. According t...
  • Sean's avatar
    Sean
    9 years ago

    brunoguedesOkay so you want the percent calculated ALWAYS from the first date selected in the slicer!

     

    Like in this picture... => % of First Selected Date's Total

     

    So to achieve this create these 4 MEASURES

     

    Total Value = SUM ( Table[Value] )
    
    First Date = CALCULATE ( FIRSTNONBLANK ( Table[Date], 1 ), ALLSELECTED ( Table ) )
    First Value =
    CALCULATE (
        [Total Value],
        FILTER ( ALLSELECTED ( Table ), Table[Date] = [First Date] )
    )
    % MEASURE = IF ( HASONEVALUE ( Table[Date] ), DIVIDE ( [Total Value] - [First Value], [First Value], 0 ) )

    Hope this helps.

    Good Luck! :smileyhappy:

  • brunoguedes's avatar
    brunoguedes
    9 years ago

    Very good! Very good!

    Thank you very much!!!