Forum Discussion

Ecobat's avatar
Ecobat
Regular Visitor
2 years ago
Solved

Running total with multi criteria

I new to BI so i'm in the early stages of coding.   I'm have an issue with my running monthly total. The running total should look at the Cost centre then by Cost Element then by date but the tota...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Ecobat ,

     

    Hope you have a nice day.

     

    Please try:

     

    CALCULATE(
        SUM('GDM COST_SUMMARY_FACT_VR'[ACTUAL_VALUE_CO_CURR]),
        FILTER(
            ALLSELECTED('GDM COST_SUMMARY_FACT_VR'),
            'GDM COST_SUMMARY_FACT_VR'[COST_CNTR_ID] == MAX('GDM COST_SUMMARY_FACT_VR'[COST_CNTR_ID])
            && 'GDM COST_SUMMARY_FACT_VR'[COST_ELEM_ID] == MAX('GDM COST_SUMMARY_FACT_VR'[COST_ELEM_ID])
            && 'GDM COST_SUMMARY_FACT_VR'[Mateix_Date]<= MAX('GDM COST_SUMMARY_FACT_VR'[Mateix_Date])
            && YEAR('GDM COST_SUMMARY_FACT_VR'[Mateix_Date]) == YEAR(MAX('GDM COST_SUMMARY_FACT_VR'[Mateix_Date]))
        )
    )

     

    Please check the table and field names for spelling errors.

     

    The DAX formula should be corrected to do what you want.

     

    If your problem cannot be solved successfully, please provide error details or a data sample set with personal privacy information and sensitive information removed. Please feel free to contact me at any time.

     

    Warm Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!