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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Quest
Advocate I
Advocate I

Help with measure removing a column from the context

Hi all,

 

I have a table with numerous fields and I want to show a table in my report with following fields only:

Date, Product Category, Unit

 

This is how my data (fields I am trying to show in my table) looks like:

Date, product category, sales unit, forecast unit

Jan , A, 10, 10

Jan, B, 15,20

Jan, C, 15,10

Feb, A, 10,20

Feb, B, 10,10

 

I want to derive the final table as below. Note that units in this table is the forecast unit - sales unit for a month, without considering the product category.

 

Date, Product category, Units

Jan , A, 0

Jan, B, 0

Jan, C, 0

Feb, A, 10

Feb, B, 10

 

I tried using All and AllExcept, but didnt seem to work. I could be doing something wrong. Please help me with this. 

1 ACCEPTED SOLUTION

Thanks a lot. I didnt create it as a measure, my bad. 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Quest , Try a measure like

calculate(sum(Table[forecast]) - sum(Table[Sales]), filter(allselected(Table), Table[Date] =max(Table[Date])))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks Amitchandak for the quick response. But this does not seem to be working for me.

Date, Product category, Units

Jan , A, 10

Jan, B, 10

Jan, C, 10

Feb, A, 10

Feb, B, 10

 

For Jan, the data should show 0 as the difference for Jan is 0 and for Feb it should show 10.

@Quest , Please find if the attached file can help

 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks a lot. I didnt create it as a measure, my bad. 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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