Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to write DAX by selecting only specific values in the rows

Hello all,

 

I'm trying to solve a problem by writing DAX.

 

I have 3 Columns in a table and the source is SSAS Datamodel.

1) Year

2) Measure

3) Cost

 

Sample data:

 

 

 

 

My expected Output should be in below format:

 

 YEAR
MeasureJul-21Aug-21Sep-21Oct-21Nov-21Dec-21Jan-22Feb-22Mar-22Apr-22May-22Jun-22
Actual678544645700666689701     
Forecast806678987909840678567678789744711700

 

For Actual , it's straight forward as it coming from one measure, but for forecast, it keeps changing every month but the measure names will remain same.

 

How can we write DAX to get forecast from the above data as an example?

 

Thanks in Advance

Dee

 

 

3 Replies

  • Anonymous , Create an order for Forecast

    then you can have measure like

    calculate(firstnonblankvalue(Table[Forecast], [Measure]), filter(Allselected(Table[Forecast]) , Table[Forecast] = max(Table[Forecast]) ) )