Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I'm quite new to Power BI and I'm stuck with this issue.
I have a table similar to the following (had to create a dummy one to post here - hope it's okay)
| ID | Click | dataset |
| 1 | 1 | A |
| 2 | 1 | A |
| 3 | 0 | A |
| 4 | 1 | A |
| 5 | 0 | A |
| 1 | 1 | B |
| 2 | 0 | B |
| 3 | 0 | B |
| 4 | 0 | B |
| 1 | 0 | C |
| 2 | 1 | C |
| 3 | 0 | C |
| 4 | 1 | C |
| 5 | 0 | C |
The column dataset is to identify the data source. You'll see each ID is repeated for each dataset.
Basically what I'm trying to do is calculate the percentage of clicks in dataset B out of the number of clicks in dataset A. The result should be: 1 / 3 = 33%
Same thing but for dataset C: 2/3 = 66%
I've tried a measure like the following:
pc_clicks_b = DIVIDE(CALCULATE(COUNTROWS(Table),
FILTER(Table,Table[clicks]=1),FILTER(Table,Table[dataset]="B")),
CALCULATE(COUNTROWS(Table),FILTER(Table,Table[clicks]=1),FILTER(Table,Table[dataset]="A")))
But it's not working. This will be used in a card.
I've tried things in other questions but I haven't seen this case asked before, if it was please direct me to it and apologies for the duplicate.
Any ideas?
@amestrian , Try one of the two options
pc_clicks_b = DIVIDE(CALCULATE(COUNTROWS(Table), FILTER(Table,Table[clicks]=1 && Table[dataset]="B")),
CALCULATE(COUNTROWS(Table),FILTER(Table,Table[clicks]=1 && Table[dataset]="A")))
or
pc_clicks_b = DIVIDE(CALCULATE(COUNTROWS(Table), FILTER(all(Table),Table[clicks]=1 && Table[dataset]="B")),
CALCULATE(COUNTROWS(Table),FILTER(all(Table),Table[clicks]=1 && Table[dataset]="A")))
That seems to have worked. Strangely, however, I had to add a filter that was already in "filters on all pages", specifically to each part of the division... not sure why that happens but it works now. I wonder if it will break somehow later because of that..
Also, can you explain why using && it works but using many FILTER() functions it doesn't? It's quite funny
Edit: one more question actually, sorry. The number is right for the general casec (without slicers), however I see my slicers won't affect these two cards, not even date slicers. Why is that?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.