Forum Discussion

Sahil_rao18's avatar
Sahil_rao18
Frequent Visitor
3 years ago
Solved

DAX

Hi All, 

 

Need your help with DAX query, I have particular column value for year, months categorized in Forecast and Actuals. 

I want the Forecast data to be taken in those months where Actuals will not be there. 

Table 

Type            Year      Month  Value
Forecast       2022      Sep       100

Actual          2022      Sep         20
Forecast       2022      Oct         10
It takes Actual values and since for Oct there is no actual value then it takes 10

  • Sahil_rao18 ,  Try measures like

     

    Actual = calculate(sum(Table[Value]), filter(Table, Table[Type]= "Actual") )

     

    Forecast = calculate(sum(Table[Value]), filter(Table, Table[Type]= "Forecast") )

     

    Sumx(Values(Table[Type]), If(isblank([Actua]) , [Forecast], [Actual]) )

  • Thank you Amit, it did help and the query got solved. Really appreciate it. 

2 Replies

  • Sahil_rao18 ,  Try measures like

     

    Actual = calculate(sum(Table[Value]), filter(Table, Table[Type]= "Actual") )

     

    Forecast = calculate(sum(Table[Value]), filter(Table, Table[Type]= "Forecast") )

     

    Sumx(Values(Table[Type]), If(isblank([Actua]) , [Forecast], [Actual]) )

  • Sahil_rao18's avatar
    Sahil_rao18
    Frequent Visitor

    Thank you Amit, it did help and the query got solved. Really appreciate it.