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
OPS-MLTSD
Post Patron
Post Patron

how to calculate and show proportion of items in a category

hello,

 

I have a table that looks similar to this 

client IDcategoryevent
123456employmentresume help
1234534employmentcareer advice
2345housingmortgage help
23935financebudget help
123874creativewriters block

 

I am tyring to create a visual that shows the proprotion of clients attending an event per category (so I would like to show the percentage) how can I achieve that?

 

I created a decomposition tree but I only want to show in a visual the part I have in the black box. How can I do that? Basically, I don't want the category or %count of client ID to show but I want the data from the event to show

If someone could please tell me how I can create a measure, that would be great

 

OPSMLTSD_0-1631156407264.png

 

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @OPS-MLTSD ,

Here are the steps you can follow:

You can use the If function to display the data you want

For example, my picture is shown as:

vyangliumsft_0-1631604917323.png

Custom rules, do not want to display career advice and resume help in column [event], 23935 in column [client ID]

1. Create measure.

Measure =
IF( MAX('Table'[event]) in {"career advice","resume help"}||MAX('Table'[client ID] )= 23935,0,1)

2. Place the measure in Filters, set is =1, apply filter.

vyangliumsft_1-1631604917324.png

3. Result:

Will only show the data you need

vyangliumsft_2-1631604917326.png

 

Best Regards,

Liu Yang

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

thank you, I have 20,000 clients in total in my table, and under the category "employment", there are 88 events, is ther a way to create the mesure so that I don't have to type each event name and client ID into the measure?

 

The clients can attend more than one event - so for example client ID # 23935 has attended 7 different events under the categories employment and housing.

 

Thank you once again

amitchandak
Super User
Super User

@OPS-MLTSD , Stacked visual or Sankey visual, you can try for this ?

thanks, is there a measure I can create to calculate the proportion? Because that's what I need

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.