Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi there,
I have two categories say [Food Group] and [Food Type] and I need to highlight Food Groups which have more than one Food Type.
So I have done a Distinct Count of Food Type and put it next to Food Group in a table then filtered the measure to >=2.
Works fine, it tells me that Fruit has 5 Food Types. But I want to expose the Food Types next to the Food Groups. As soon as I put Food Type in the table, it makes each value 1 so the data disappears and if I remove the filter, it simply pulls in the first found Food Type per Group.
Can you help me with a way to show the following, but only Groups with more than one Food Type?
Food Group | Food Type |
Fruit | Apple |
Orange | |
Banana | |
Tomato | |
Kiwi | |
Vegetable | Brocolli |
Kale |
Solved! Go to Solution.
Try
Num food type =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Food Type] ),
REMOVEFILTERS ( 'Table' ),
VALUES ( 'Table'[Food Group] )
)
For your refeence.
Step 0: I use your data.
Step 1: I make a measure and a matrix.
Try
Num food type =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Food Type] ),
REMOVEFILTERS ( 'Table' ),
VALUES ( 'Table'[Food Group] )
)
Thank yiou @johnt75 this works perfectly!
Actually- now I want it to do something else. It's repeating the total of 5 against every row of Food Type. Is there a way to show the value only once like in the sub total field?
I've tried playing around with the sub-total field and formatting to make values white but it's not working.
User | Count |
---|---|
84 | |
79 | |
71 | |
48 | |
43 |
User | Count |
---|---|
111 | |
54 | |
50 | |
40 | |
40 |