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
matrix_user
Helper III
Helper III

A solution to subtract between two periods based on report year (not year) and filtered by quarter

I am trying to find a DAX solution or not so DAX to have the difference between two columns:

matrix_user_0-1675934092628.png

I want to be able to subtract, for example California's Min of Remaning 2022 with Min Remain 2021 as well as Min Sold 2022 with Min Sold 2021. The calculation is filtered by Quarter 3.

 

The end result I am looking for is "+3" in the table below ("Sold change").

matrix_user_1-1675934303135.png

Onedrive

https://1drv.ms/u/s!AjsGK-eaU2PkgRkPsxf0g0p9lrIv?e=aajEir

 

Dropbox

https://www.dropbox.com/scl/fo/80ekjxxz6j7j214b0qyqf/h?dl=0&rlkey=51t12rrnw114jj78ejqlk2nvq

3 REPLIES 3
AdaKAda
Helper I
Helper I

You have to change the [Year] to a Whole number datatype for this: 
 
Remaining change = min('Fact table'[Remaining]) - calculate(MINX('Fact table', [Remaining]), 'Fact table'[Year] = SELECTEDVALUE('Fact table'[Year])-1)
 
Sold change = min('Fact table'[Sold]) - calculate(MINX('Fact table', [Sold]), 'Fact table'[Year] = SELECTEDVALUE('Fact table'[Year])-1)
 
 
AdaKAda
Helper I
Helper I

🤔According to your description the Sold change highlighted should be +1 not +3?

My apoligies, yes you are correct.

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.