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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ben_E_556
Frequent Visitor

Pie chart with Count of X as the legend

Hello,

 

I have a map visual that shows the count of a column ("Goal") by Utility. I have a filter for Goal so that only one Goal is counted. For example (using sample data below), if I've selected Minimum in my Goal filter, the count will be A = 3, B = 3, C = 2. I also have filters for Capability, so if I filter to Cyber and Metering, the Minimum counts will be A = 1, B = 1, C = 2. 

 

I want to make a Pie Chart that summarizes the share of utilities with each count based on my Goal and Capability selections. In my first example the pie chart would show that 66% have a count of 3 and 33% have a count of 2. In the second example it would show that 66% have a count of 1 and 33% have a count of 2. The problem I'm running into is I'm not able to use Count of Goal as the legend variable for the pie chart. Using Count of Goal as the legend and Count of Utility as the values would achieve what I'm going for.

 

I tried make a summary table based on my initial table that calculates count of goal and used count of goal from the summary table as the legend variable. Then the pie chart works fine if no capabilities are filtered out, but it doesn't change depending on the capabilities filtered. 

 

UtilityCapabilityGoal
AOptimizationMinimum
ATelecomMinimum
ACyberMinimum
AMeteringGoal
BOptimizationMinimum
BTelecomMinimum
BCyberGoal
BMeteringMinimum
COptimizationGoal
CTelecomGoal
CCyberMinimum
CMeteringMinimum
Goal Summary = SUMMARIZE('Utility Goals', ''Utility Goals'[Utility], ''Utility Goals'[Goal], "Count of Goal", COUNTROWS(''Utility Goals'))
2 REPLIES 2
Anonymous
Not applicable

Hi @ben_E_556 ,

Please have a try.

Create a measure.

Legend = 
VAR _selectedLevel = SELECTEDVALUE ( Legend[Level] )
RETURN
    SWITCH (
        _selectedLevel,
        1, SELECTEDVALUE ( Fact[Region] ),
        2, SELECTEDVALUE ( Fact[State] ),
        3, SELECTEDVALUE ( Fact[County] )
    )

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Hello. This doesn't make sense in the context of the sample data I provided. I don't understand how this would be applied to my scenario and data.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.