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
dalmar22
Frequent Visitor

Measure for max in category without using category filter

So I have dashboard in which I rank companies in several Aspects. Each company belongs to one Industry.

What I want to do is select company in Company slicer and see on a line chart score for that company in different Aspects. Besides that I want to have another line in that chart, which would be showing Maximum Score for the industry from which I selected the company. Currently  the Maximum Score  works for me correcctly only when I select both company and industry, even though once I select company I can select only one industry as all the others are filtered out. What I want is to select company without need to select industry.

 

I defined the measure for Maximum score for industry following:

 

Max_score_industry = CALCULATE(MAX(DataTable[Score]),ALLEXCEPT(DataTable,DataTable[Aspect],DataTable[Industry]))

 

Hope I am clear enough, all data is in one simple table. Any idea how should I define my Max_score_industry measure or what else I need to change?

 

Thank you

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Share a simple dataset and show the expected result in a simple Table format.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur @v-easonf-msft ,

please find my simplified file, desription of the problem is included. Thanks a lot for your suggestions.

 

 

Hi,

You  may download my PBI file from here.  See the result of the measure "Max_score_industry try".  It works even without selecting the Industry.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-easonf-msft
Community Support
Community Support

Hi,  @dalmar22 

Did you want to have another line in the chart?

Maybe you can try to create another Axis and apply it to  line chart visual.
For example:

 

 

Axis = UNION(DISTINCT('DataTable'[Industry]),SELECTCOLUMNS({{"0"},{"Z"}},"Industry",[Value]))

 

 

Then you need to  create the corresponding measure "Max_score_industry"  as value.

Here is  demo .   ( please ignore the Measure "Max_score_industry" in demo,it is not right. ) This demo is  just  used to better express my idea .Hope it can bring you some ideas.

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-easonf-msft ,

thanks for your suggestion, I am afraid the file you attached is not the correct one, as i dont see anywhere "Max_score_industry".

Can you please check?

 

Thanks a lot.

Hi , @dalmar22 

Sorry for my mistake.Please check it here.

Here I just put forward my idea, please ignore the measure I wrote, because it is incorrect, it still needs to be modified .

 

Best Regards,
Community Support Team _ Eason

parry2k
Super User
Super User

@dalmar22 remove INdustry column from ALLEXCEP  function.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks for respond @parry2k , however when I do that the measure shows maximum across all the companies. What I need is to show only maximum for the industry from which I selected company. 

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.