Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Running Total starting from Measure

Hi

Maybe one of you can help me with by calculation.

 

I have a running total starting from measure, dax function is working as expected,

Measure calculation should start from value 149.421 and decrease until 0.

Unfortunatelly the "grand total" in the table is not the expected value. (Check screenshot)

 

Thanks

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    use this as the last line of your code.

     

    RETURN
    IF ( HASONEVALUE ( Table[DateColumn] ), Result )

    This code will return blank for the grand total section.  More specifically, whenever there is more than 1 date in the filter context.

     

    Modify the Table[DateColumn] with the appropriate table name and column name (I'm not sure if you're using a calendar table, or just the date in your fact table).

     

    Nice job using variables in your DAX, makes it much easier to read and troubleshoot!

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Hi Anonymous,

    Have you resolved your issue? If you have, welcome to share your solution or mark the right reply as answer. More people will benefit from here, and we can close the thread.

    Best Regards,
    Angelia