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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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

 

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors