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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
y5famfnatudu
Helper III
Helper III

Rolling difference (measure)

Greetings,

I have a customer table with a measure computing the total revenue generated by each customer. Additionally, I've included a ranking column, sorting customers from the lowest to the highest revenue.

y5famfnatudu_0-1708338682994.png

I am seeking to create a new measure that calculates the percentage difference from the lowest revenue to the highest.

Kindly note that I can't create calculated columns

Best regards,
Simon

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@y5famfnatudu , Use offset function

 

Offset Previous Rank = CALCULATE(Sum([Revenue]),OFFSET(-1, ALL('Table'[Name],'Table'[Rank]),ORDERBY('Date'[Rank])))

 

 

You can then take a diff

sum(Table[Revenue]) - [Offset Previous Rank]

 

I assumed Revenue is a column, if it is measure no need for Sum

 

Continue to explore Power BI Offset Compare Categories, Time Intelligence MOM, QOQ, and YOY: https://youtu.be/5YMlkDNGr0U

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@y5famfnatudu , Use offset function

 

Offset Previous Rank = CALCULATE(Sum([Revenue]),OFFSET(-1, ALL('Table'[Name],'Table'[Rank]),ORDERBY('Date'[Rank])))

 

 

You can then take a diff

sum(Table[Revenue]) - [Offset Previous Rank]

 

I assumed Revenue is a column, if it is measure no need for Sum

 

Continue to explore Power BI Offset Compare Categories, Time Intelligence MOM, QOQ, and YOY: https://youtu.be/5YMlkDNGr0U

Thank you @amitchandak, but Rank is not a column in a table, rather a measure that I created.

__CustomerRank =
RANKX ( ALLSELECTED ( 'Customers' ), [Revenue],, ASC, DENSE )

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.