Forum Discussion

tanct's avatar
tanct
Regular Visitor
8 years ago
Solved

Running total

 

Hello All,

Would need your help in the DAX running total for the below scenario (running total for the MTD - month to date and PM - previous month):-

 

 

My Dax:

RunningTotal =
 VAR
    CurrentDay = MAX ( 'Data Source'[Weekday] )
 RETURN CALCULATE (
  SUMX ( VALUES ( 'Data Source'[Weekday] ), sum('Data Source'[Standard Quantity KG 3rd Party]) ),
  'Data Source'[Weekday] <= CurrentDay
 )

 

First time I posted my question here, thanks for your kind assistance.

Unable to send the BI file over here, do let me know should you need it.

Thanks!!

 

 

 

  • Hello friend

    tanct

     

    This shall do it

     

    Cumulative  =
    SUMX (
        FILTER (
            ALLEXCEPT (
                'Data Source',
                'Data Source'[Reformat],
                'Data Source'[SH - Country  docum.]
            ),
            'Data Source'[Weekday] <= SELECTEDVALUE ( 'Data Source'[Weekday] )
        ),
        CALCULATE ( SUM ( 'Data Source'[Standard Quantity KG 3rd Party] ) )
    )

7 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    tanct

     

    Try this Measure

     

    Cumulative =
    IF (
        HASONEVALUE ( 'Data Source'[Weekday] ),
        SUMX (
            FILTER (
                ALL ( 'Data Source' ),
                'Data Source'[Weekday] <= VALUES ( 'Data Source'[Weekday] )
            ),
            'Data Source'[Standard Quantity KG 3rd Party]
        )
    )
    • tanct's avatar
      tanct
      Regular Visitor

      Dear Zubair,

       

      It is still not working. This is my first time publish my issue here, do you know how to share the pbix file over here, it would be more efficient in this way.

      • Zubair_Muhammad's avatar
        Zubair_Muhammad
        Community Champion

        Hi tanct

         

        You can upload your file to onedrive or google drive and share the link here using "insert/edit link" option