Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
sshantaram
Frequent Visitor

Cumulative Dax expression for multiple dimension - Product and Year-Month

Hello All,

 

I want to achieve cumulative growth of Product with respective to Year-Month. I am able to achieve it with respect to Year-Month but when I try to achieve it based on other dimension like Product, my logic fails. I am sharing a simple example in the screenshot

 

sshantaram_1-1628089761363.png

 

Kindly let me know if there is a way to achieve this, also will the logic apply to Product-->Sub-Product-->Year-Month

 

Thank you for your time

 

Warm Regards

SK

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @sshantaram 

 

To create a measure like this:

 

Measure =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Product] ),
        'Table'[Date] <= MAX ( 'Table'[Date] )
    )
)

 

Result:

vangzhengmsft_0-1628227743257.png

Please refer to the attachment below for details

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-angzheng-msft
Community Support
Community Support

Hi, @sshantaram 

 

To create a measure like this:

 

Measure =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Product] ),
        'Table'[Date] <= MAX ( 'Table'[Date] )
    )
)

 

Result:

vangzhengmsft_0-1628227743257.png

Please refer to the attachment below for details

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-angzheng-msft Thank you it works. I learnt something new 🙂

amitchandak
Super User
Super User

@sshantaram , first you need to unpivot the year data.  That will give value column

https://radacad.com/pivot-and-unpivot-with-power-bi

You need to have a year table 

Create a measure like one below and use in matrix with year and product

calculate(sum(Table[Value]) , filter(allselected(year), Year[Year] <=  Max(Year[Year])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak Thank you for your reply. I have used this calculated measure before "calculate(sum(Table[Value]) , filter(allselected(year), Year[Year] <=  Max(Year[Year])))" but it only works when you have only Time Dim .. but if you add a Product Dim along with Time Dim, we wont get the result. 

 

sshantaram_0-1628148685537.png

 

Kindly help.

 

Warm Regards,

SK

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.