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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

how to calculate cumulative decrease use DAX

Hi, experts, I want to get the gap of the relevant value, for example, the "cal" column in the picture, do you have any solutions?

null_0-1671167005760.png

 

1 ACCEPTED SOLUTION
Mahesh0016
Super User
Super User

VAR PreviousRow = CALCULATE( [Orders], OFFSET( -1, ALLSELECTED('Product'[yearmonth]), ORDERBY('Product'[yearmonth], ASC) ) )
RETURN [# Orders] - PreviousRow


Hello @Anonymous ,
I hope this helpful for you if not so can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

View solution in original post

5 REPLIES 5
Mahesh0016
Super User
Super User

VAR PreviousRow = CALCULATE( [Orders], OFFSET( -1, ALLSELECTED('Product'[yearmonth]), ORDERBY('Product'[yearmonth], ASC) ) )
RETURN [# Orders] - PreviousRow


Hello @Anonymous ,
I hope this helpful for you if not so can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Hi,

What is the [Order] in the above function?

Hello @sivasrao ,
[Order] is Measure.

Hi, 

thank you for your quick reply.

What is in [Order] measure?

Can you please elaborate on the total function? 

 

Anonymous
Not applicable

Thanks, I am not quiet understand [# Orders] of "RETURN [# Orders] " , can you tell me what it stands for? Thanks.

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.