Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Need your help with a DAX formula

Hello,   I'm new to DAX. I want to sum the annual costs. Meaning if its February the meassure should take actuals for January and for the remaining months the planning category. Is there someone wh...
  • v-danhe-msft's avatar
    v-danhe-msft
    7 years ago

    Hi Anonymous ,

    Based on my test, you could refer to below steps and I suggest you use number to show your month:

    Create a distinct table for month column:

    New Table = DISTINCT('Table1'[Month])

    Create below measure:

    Measure = CALCULATE(SUM(Table1[Costs]),FILTER('Table1','Table1'[Month]<=SELECTEDVALUE('New Table'[Month])&&'Table1'[Categroy]="Actuals"))+
    CALCULATE(SUM(Table1[Costs]),FILTER('Table1','Table1'[Month]>=SELECTEDVALUE('New Table'[Month])&&'Table1'[Categroy]="Planning"))
    Result(Use the [Month] in new table as slicer):
    You could also download the pbix file to have a view.
     
    Regards,
    Daniel He