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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Newbie2712
New Member

How to transform Calculated Column function to Measure

Newbie2712_0-1689820477325.png

I have this function but it only work in calculated column but i want it to be a measure

Please help me 

Thanks for your help

 

data: 

Newbie2712_0-1689822124012.png

I want it to be like this:

Newbie2712_2-1689822201226.png

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Newbie2712 

You can use offset function.

e.g  

 

Measure = CALCULATE(SUM('Table'[TotalOrder]),OFFSET(-1,ALLSELECTED('Table'[Mon]),ORDERBY([Mon],ASC)))

 

Output

vxinruzhumsft_0-1690180848701.png

 

Best Regards!

Yolo Zhu

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Newbie2712 

You can use offset function.

e.g  

 

Measure = CALCULATE(SUM('Table'[TotalOrder]),OFFSET(-1,ALLSELECTED('Table'[Mon]),ORDERBY([Mon],ASC)))

 

Output

vxinruzhumsft_0-1690180848701.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Share some data in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.