Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DAX Help on Sum

Hi,

 

Need help in attached file. I've the calcualted Columns attached in my dataset.  I've Columns 

 

Month, Result and Diff.

 

Requirements are

 

 1. The required column should be sum of all values of "Diff" till Jul and from Aug it should reflect "Result" values, and the scenario will continue in preceeding Months like in Aug it should reflect the sum of values of "Diff" and from Sep it should get the values from "Result" Column.

2. Need a Dax to get the result Dynamycally to get the values based on Month selection.

 

Please find the sample file and please let me know if you need further details.

https://drive.google.com/file/d/1pTUI-GDnNiKRy1v2DW5zngxKI6DyF0_p/view?usp=sharing

 

Regards,

  • Hi

    You could create a table for Month slicer, then use below measure

    measurem =
    IF (
        MONTH ( MIN ( Table6[date] ) ) > SELECTEDVALUE ( 'Month'[month] ),
        SUM ( Table6[amount] ),
        SUM ( Table6[diff] )
    )

    Best Regards,

    Zoe Zhi

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Please try below measure:

    Measure 2 = IF(MAX('Table (2)'[Month]) < DATE(2019,8,1),SUM('Table (2)'[Diff]),SUM('Table (2)'[Result]))

    Aiolos Zhao

  • dax's avatar
    dax
    Community Support

    Hi

    You could create a table for Month slicer, then use below measure

    measurem =
    IF (
        MONTH ( MIN ( Table6[date] ) ) > SELECTEDVALUE ( 'Month'[month] ),
        SUM ( Table6[amount] ),
        SUM ( Table6[diff] )
    )

    Best Regards,

    Zoe Zhi

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.