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
Anonymous
Not applicable

Return Max Value of Category when Data has Two Different Demands With and WIthout a Subcategory

Hello,

 

I’m trying to list two different demands for each Category in a table, one of which has the demand further broken down by Type but where this isn't the case for the other, which just has the aggregated value for Category. The Category also needs to be mapped to its particicular month - there are repeating Category names populating different months in the year - and work with further filter contexts in the table. For the demand without the breakdown by Type, I understand I need to return the max value per Category rather than having all the values summed. An example of the data is shown below:

 

Daniel7_0-1678110380238.png

 

My data repeats across the year for different Categories but as seen, is only broken down by Type for Current Demand. When I list things in a table, I’m looking for a way to list both demands to compare but importantly, also a way to list the demand by Type for Current Demand (or ideally any other field whether at a more aggregated or broken down level) even though we don’t have this level for Previous Demand. Whether Previous Demand just shows no entries or has fake placer values to reach the correct aggregate I’m not much fussed about. So far I have tried creating the following measures but with no success:

 

Previous Demand Max = MAX(Products[Previous Demand])

Previous Demand = CALCULATE([Previous Demand Max], ALLEXCEPT(Products, Products[Category]))

 

Any ideas on how I could acheive this would be much appreciated.

4 REPLIES 4
andhiii079845
Solution Sage
Solution Sage

Please make a little example with a table. This more easier what do you want to see. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

I've managed to fix this now in a different post on the other way to tackle this (transforming data in PQ), but thank you anyway. I was probably overcomplicating here.

andhiii079845
Solution Sage
Solution Sage

Can you share please the underlaying data and a example want you really want.  A good example is more than 100 word 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

I think an easier solution to my issue is whether there is a way to change the repeating values in my Previous Demand column to null/zero. Therefore, in my example, I would just have one '40' value within the index Jan 23 - Bicycle. Does anyone have any idea?

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.