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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Compare table of values to first value

I have a table compomised of two different forecasts, and the month lag they were submitted. 
I select the month they are for, and it will show me the past forecasts.

I want to compare the first value of each column to each preceding value.

 

Additionally, I want to to do the same, but instead of the first forecast value, I would like the key comparison value to be a new column/measure (In my case, actuals).

 

Due to the way I have the data transformed, for each month there are duplicates for each actual value, depending on how many versions of each forecast there are.

 

Sample PBI report with a few examples of what I hope to show.

Sample File 

 

Sample table of the data.

SKUMonthForecast CreationRegionTypeActualsForecast TypeForecast
30069Jan-24Dec-23EnglandFranchise200Original100
30069Jan-24Dec-23EnglandEquity2000Original1000
30069Jan-24Dec-23IrelandFranchise75Original2000
30069Jan-24Dec-23IrelandEquity750Original2100
40069Jan-24Dec-23EnglandFranchise1000Original500
40069Jan-24Dec-23EnglandEquity1000Original1700
40069Jan-24Dec-23IrelandFranchise2100Original450
40069Jan-24Dec-23IrelandEquity750Original500
50069Jan-24Dec-23EnglandFranchise299Original450
50069Jan-24Dec-23EnglandEquity250Original200
50069Jan-24Dec-23IrelandFranchise600Original450
50069Jan-24Dec-23IrelandEquity750Original900
30069Jan-24Dec-23EnglandFranchise200Updated110
30069Jan-24Dec-23EnglandEquity2000Updated1100
30069Jan-24Dec-23IrelandFranchise75Updated2200
30069Jan-24Dec-23IrelandEquity750Updated2310
40069Jan-24Dec-23EnglandFranchise1000Updated550
40069Jan-24Dec-23EnglandEquity1000Updated1870
40069Jan-24Dec-23IrelandFranchise2100Updated495
40069Jan-24Dec-23IrelandEquity750Updated550
50069Jan-24Dec-23EnglandFranchise299Updated495
50069Jan-24Dec-23EnglandEquity250Updated220
50069Jan-24Dec-23IrelandFranchise600Updated495
50069Jan-24Dec-23IrelandEquity750Updated990
30069Jan-24Nov-23EnglandFranchise200Original50
30069Jan-24Nov-23EnglandEquity2000Original500
30069Jan-24Nov-23IrelandFranchise75Original1000
30069Jan-24Nov-23IrelandEquity750Original1050
40069Jan-24Nov-23EnglandFranchise1000Original250
40069Jan-24Nov-23EnglandEquity1000Original850
40069Jan-24Nov-23IrelandFranchise2100Original225
40069Jan-24Nov-23IrelandEquity750Original250
50069Jan-24Nov-23EnglandFranchise299Original225
50069Jan-24Nov-23EnglandEquity250Original100
50069Jan-24Nov-23IrelandFranchise600Original225
50069Jan-24Nov-23IrelandEquity750Original450
30069Jan-24Nov-23EnglandFranchise200Updated55
30069Jan-24Nov-23EnglandEquity2000Updated550
30069Jan-24Nov-23IrelandFranchise75Updated1100
30069Jan-24Nov-23IrelandEquity750Updated1155
40069Jan-24Nov-23EnglandFranchise1000Updated275
40069Jan-24Nov-23EnglandEquity1000Updated935
40069Jan-24Nov-23IrelandFranchise2100Updated247.5
40069Jan-24Nov-23IrelandEquity750Updated275
50069Jan-24Nov-23EnglandFranchise299Updated247.5
50069Jan-24Nov-23EnglandEquity250Updated110
50069Jan-24Nov-23IrelandFranchise600Updated247.5
50069Jan-24Nov-23IrelandEquity750Updated495
2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , You can use offset or the new previous Table level calculation 

 

example, Please include all the column in visual

 

Last Category Brand = CALCULATE([net], OFFSET(-1, ALLSELECTED('Item'[Brand],'Item'[Category]), ORDERBY('Item'[Category],asc),KEEP,PARTITIONBY('Item'[Brand])))
Next Category Brand = CALCULATE([net], OFFSET(1, ALLSELECTED('Item'[Brand],'Item'[Category]), ORDERBY('Item'[Category],asc),KEEP,PARTITIONBY('Item'[Brand])))

 

PARTITIONBY is optional 

 

In case you have column across tables

Last Category Brand = CALCULATE([net], OFFSET(-1, Summarize(ALLSELECTED(Sales) , Geo[City], 'Item'[Brand],'Item'[Category]), ORDERBY('Item'[Category],asc)))

 

 

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

 

Power BI Update: Visual calculations (preview)
https://powerbi.microsoft.com/en-us/blog/visual-calculations-preview/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi amitchandak, 

 

Thanks for replying and sharing the video.

I've already been able to work out offset for previous values / next value. 
The help I need is to offset, but always point to the first rows value, rather than the previous rows value.

 

Example.PNG

 

In my example above, I want the offset to always look at the row M-01. 
The formula will need to be " M-01 - M-## " With the ## increasing, but always compared to M-01.

 

I was able to get it to work without column across table using filter. However, it doesnt work when using column across table. - In my sample file, I have called this measure.

 

Thanks

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.