I have a table that looks like this:
I'm trying to create a table visual with a column to indicate how many distinct IncidentCodes each Asset has, which would look like this:
Of course if I add a column with a count of the IncidentCode, I get "1" for each row.
Is there something simple I'm missing?
Solved! Go to Solution.
If you add the column again and make it do a Distinct Count, it'll use the context of the table. Try the following measure:
This works well - except that it breaks the filter I'm using to get the table in the first place. My data actually looks like this:
I have another table, related one-to-many on Asset
I'd been filtering the FullTable visual by SwitchTable [is not blank]. When I applied the measure as written, I got all of the FullTable Assets. I tried modifying it as below, but got the one-per-row problem again.
Try this measure:
StableIncidentsMeasure = CALCULATE(DISTINCTCOUNT(FullTable[IncidentCode]), ALLEXCEPT(FullTable,Fulltable[Asset]), ALLNOBLANKROW(SwitchTable[Asset]))
Thanks! Now I'm being asked for further filtering of the data, so I think that I'm just going to give them a matrix and call it a day, but I really appreciate the help!
Take a look at the September 2023 Power BI update to learn more.
Join Microsoft Reactor and learn from developers.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!
Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.