Forum Discussion

SHILL's avatar
SHILL
Frequent Visitor
2 years ago
Solved

Percentage Difference

I have the example graph below and I need to get a percentage that shows the difference against our start of year plan. For example, the start of the year plan we forecast a total of 30 sales, the Q1...
  • Irwan's avatar
    2 years ago

    hello SHILL 

     

    please check if this accomodate your need.

     

     

    Create a measure wiht following DAX:

    Calculate =
    var _Status = SELECTEDVALUE('Table'[Plan Forcasted])
    var _StartofYear = CALCULATE(SUM('Table'[Totals]),'Table'[Plan Forcasted]="Start of year")
    Var _Q1 = CALCULATE(SUM('Table'[Totals]),'Table'[Plan Forcasted]="Q1")
    var _Q2 = CALCULATE(SUM('Table'[Totals]),'Table'[Plan Forcasted]="Q2")
    Return
    IF(
        _Status="Start of year",
        "",
    IF(
        _Status="Q1",
        DIVIDE(_Q1,_StartofYear),
    IF(
        _Status="Q2",
        DIVIDE(_Q2,_StartofYear)
    )))
     
    Hope this will help you.
    Thank you.