Forum Discussion

rp2022's avatar
rp2022
Helper II
2 years ago
Solved

Help with some measures

Sample the excel file with data.

 

 

I need to get 2 measures:

1. Calculate running total summing up everything to the End of the Year based on Label. (should work in a table or matrix visual with any level of detail) But also, keep PD and PDY separate from the running total. The totalling start from Label="ST" and cummulative after that till the end of the year.

 

2. A Cummulative total until Nov end and then show how values might influence in Dec for DELK level detail. Hierarchy is R -> P-> Prod -> Area -> DELK, also based on Label

 

I have a current measure for #1, but when i bring details into the visual like Prod, the values are all the same.

 

Any help is appreciated

  • Anonymous's avatar
    Anonymous
    2 years ago

    HI rp2022,

    You can use switch function or if statement to check current hierarchy levels, then you can use this to redirect to different calculations based on current level and use these logic formulas into the same measure.

    Regards,

    Xiaoxin Sheng

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI rp2022,

    I'd like to suggest you take a look at the following link to know how to use dax expression to check the hierarchy level:

    Clever Hierarchy Handling in DAX - SQLBI

    Then you can write different formula based on current level to calculate cumulative results.

    Regards,
    Xiaoxin Sheng

    • rp2022's avatar
      rp2022
      Helper II

      I do not wish to create a measure for each level. I want one measure that works for all levels

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI rp2022,

        You can use switch function or if statement to check current hierarchy levels, then you can use this to redirect to different calculations based on current level and use these logic formulas into the same measure.

        Regards,

        Xiaoxin Sheng