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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Arti12
Frequent Visitor

Substract column - measure

Hi Guys,

I have 42 weeks with data in the matrix table. When choosing from the filter (2 weeks), I would like to be able to subtract the values ​​from each other. But I would like to be able to subtract values ​​from different weeks (depending on which I choose from the filter) - e.g. week 4 - week 5. But it could also be week 40 - week 32.
How can I make such a column at the end?
The problem is also that I can't add any new columns to the model, I have to rely on measures.

Please find the screen below.

 

1.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Arti12 , A measure like

 

sales =
var _max = maxx(allselected('Date'),'Date'[Week])
var _min = minx(allselected('Date'),'Date'[Week])

return
calculate([Measure], filter('Date', 'Date'[Week] =_max)) - calculate([Measure], filter('Date', 'Date'[Week] =_min))

 

 

or

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Arti12 , A measure like

 

sales =
var _max = maxx(allselected('Date'),'Date'[Week])
var _min = minx(allselected('Date'),'Date'[Week])

return
calculate([Measure], filter('Date', 'Date'[Week] =_max)) - calculate([Measure], filter('Date', 'Date'[Week] =_min))

 

 

or

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

Dear @amitchandak,

Thanks for answer. Unfortunately I can't send the source but let me be more specific.

 

Arti12_0-1636100181236.png

 

The problem is that I cannot insert any column in the model, only measures. I would like to have only one value in the end - the result of substraction.

Is it possible to implement?

 

I've tried your measure but it didn't work.

 

BR,

Artur

 

 

 

 

Anonymous
Not applicable

Hi @Arti12,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Arti12
Frequent Visitor

Anyone? 🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors