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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Subtract Values Row by Row with EARLIER function

Dear Contributors, 

 

Please help me to adjust the Calculated Column formula, so that the outcome was the same as the Measure.

Note, that for Calculated Column a Base value (Resources Needs) is not summarized by date, opposed to the Measure.

 

Difference Column = 'Resources Needs'[Resources Needs]-CALCULATE(MAX('Resources Needs'[Resources Needs]);FILTER('Resources Needs';'Resources Needs'[Project]=EARLIER('Resources Needs'[Project])&&'Resources Needs'[Position]=EARLIER('Resources Needs'[Position])&&'Resources Needs'[Recruitment Status]=EARLIER('Resources Needs'[Recruitment Status])&&'Resources Needs'[Date]<EARLIER('Resources Needs'[Date])))

 Capture Dif Column_Months Resources Needs Don't Summarized.JPG

 

 

Difference Measure = SUM('Resources Needs'[Resources Needs])-CALCULATE(SUM('Resources Needs'[Resources Needs]);PARALLELPERIOD('Resources Needs'[Date];-1;MONTH))

Capture Dif Measure.JPG

 

Pbix file is available here

 

Best regards,

Anna

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

I doubt that MIN, as well as MAX is correct for my case:

Capture Dif Column MAX and MIN.JPG

 

 

Basically I need (Sum [Resources Needs] within a Month)  - (Sum [Resources Needs] within a Previous Month), but in this case how to deal with the result:

  Capture Dif Column....JPG

View solution in original post

I guess where I was going with that is that you appear to have multiple matching rows so you either need to have better filters or you are going to need a different aggregation like AVERAGE or something.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

What happens if you substitute MIN for MAX in your column formula?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I doubt that MIN, as well as MAX is correct for my case:

Capture Dif Column MAX and MIN.JPG

 

 

Basically I need (Sum [Resources Needs] within a Month)  - (Sum [Resources Needs] within a Previous Month), but in this case how to deal with the result:

  Capture Dif Column....JPG

I guess where I was going with that is that you appear to have multiple matching rows so you either need to have better filters or you are going to need a different aggregation like AVERAGE or something.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors