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
powerdev
Regular Visitor

Creating a percentage graph

I am attempting to show a distribution of patient risk across a 1 - 100 scale. I can produce the following graph that shows deitentified patient ids and their total risk score.

 

PowerBiDiscussionRiskScores

 

What I would ultimately like to do with this data is create the following chart showing the total percentage on the x axis and the count of patients in each bucket.

 

PowerBiDiscussionRiskScores2

 

I just cannot seem to figure out how to use accomplish this. It appears that a good use case for this is binning, but my final output is a calculated field and the option for a new group is not available. Any suggestions?

4 REPLIES 4
powerdev
Regular Visitor

Hmmm... I am not getting much feedback on this.

 

Can anyone tell me if it is possible to take a result set (from a view) (calculated from several calculated measures) like the following:

 

PowerBiDiscussionRiskScores

 

and turn it into a new table? I am sure that I could then use binning to achieve the visual that I need.

@powerdev

 

Hi, If your BINs are 0 to 100 and Risk Score is a WholeNumber between 0 to 100. You can try with this:

 

1. Create a Table with Bins:

 

Modeling--New Table

 

Bins = GENERATESERIES(0;100;1 )

2. Create a CountofPatientID

 

CountOfIds =
CALCULATE (
    COUNT ( Table2[PatientID] );
    FILTER ( Table2; [AVG Risk Score] = SELECTEDVALUE ( Bins[Value] ) )
)

AVG Risk Score is your measure

 

3. Insert a Visual:

 

chart.png

To select the colors you can work with Data Colors (But you need to assign to each bin the color )

 

Let me know if works on your side

 

Regards

 

Victor

Lima . Peru




Lima - Peru
v-yulgu-msft
Employee
Employee

Hi @powerdev,

 

Aggree with the solution you mentioned that to use "Bin" to generate new group. But what do you mean "my final output is a calculated field and the option for a new group is not available"? After creating a bin based on a specific field, it will dynamically add a calculated column in table view, you just need to add this new field into X-axis of column chart.

 

Regards,

Yuliana Gu

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

Thanks @v-yulgu-msft for the reply.

 

What I mean is that the "Risk Score" column above is itself a calculated measure. When I select it and try to select "New Group" from the menu it is greyed out. I am thinking that creating a group from a calculated measure isn't possible. Is this correct?

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