cancel
Showing results for
Did you mean:
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:

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").

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
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)

Helper I

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

Helper III

My apoligies, yes you are correct.