Forum Discussion

lacq's avatar
lacq
Regular Visitor
8 years ago
Solved

DAX: Rollup value within a group

Hi Community,

 

I've one question, maybe a silly one, but I already wasted some time trying to solve the following requirement...

 

I've the following very simple star schema model in my PBI file, and what I want to do is to roll up the value measure per Country Name... I'm able to roll up the value by date, but I need to group the RollupValue by Country Name.

 

 

Probably I'm missing something very simple....

 

Have you ever have to solve a problem like this one? if so, can you share your solution with me?

 

Many Thanks, Lacq

  • Hi lacq

     

    First add a calculated column in your FactValues

     

    Use this Column in the Visual

     

    CountryName = related(DimCountry[CountryName])

     Now you can use this MEASURE to get the Cumulative

     

    Cumulative =
    CALCULATE (
        SUM ( FactValues[Value] ),
        FILTER (
            ALLEXCEPT ( FactValues, FactValues[CountryName] ),
            FactValues[Date] <= SELECTEDVALUE ( FactValues[Date] )
        )
    )

8 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Icon for Community Champion rankCommunity Champion

    Hi lacq

     

    First add a calculated column in your FactValues

     

    Use this Column in the Visual

     

    CountryName = related(DimCountry[CountryName])

     Now you can use this MEASURE to get the Cumulative

     

    Cumulative =
    CALCULATE (
        SUM ( FactValues[Value] ),
        FILTER (
            ALLEXCEPT ( FactValues, FactValues[CountryName] ),
            FactValues[Date] <= SELECTEDVALUE ( FactValues[Date] )
        )
    )