Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hi,
I have a basic measure that counts the number of PrimaryTopics there are in the database:
Primary Topic Count =
DISTINCTCOUNT('Cases'[PrimaryTopic2])
I would like to count the numbers of Primary and Secondary Topics seperately when one or the other is in scope but I'm not sure how to do it?
There shouldn't be any 1's in the Primary Topic column unless its a Primary Topic.
Can anyone help?
Thanks,
Solved! Go to Solution.
Hi @ArchStanton
I am assuming the bold rows are the primary topics:
Create a new measure:
Count Secondary =
IF(
isinscope('Cases'[SecondaryTopic]) --Returns true for Admin but false for Auto enrolement
,DISTINCTCOUNT('Cases'[SecondaryTopic])
)
For the primary its a little harder as IsInscope would return TRUE on the row of Auto and Admin since Admin is nested into Auto.
Count Secondary =
IF(
Not(isinscope('Cases'[SecondaryTopic])) && isinscope('Cases'[PrimaryTopic2])
--Must return FALSE on Admin AND return TRUE on Auto (excludes row and grand total)
,DISTINCTCOUNT('Cases'[PrimaryTopic2])
)
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Hi @ArchStanton ,
I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please let us know so that we can assist you better.
Thank You @SamWiseOwl for your prompt response to the query.
Hi @ArchStanton
I am assuming the bold rows are the primary topics:
Create a new measure:
Count Secondary =
IF(
isinscope('Cases'[SecondaryTopic]) --Returns true for Admin but false for Auto enrolement
,DISTINCTCOUNT('Cases'[SecondaryTopic])
)
For the primary its a little harder as IsInscope would return TRUE on the row of Auto and Admin since Admin is nested into Auto.
Count Secondary =
IF(
Not(isinscope('Cases'[SecondaryTopic])) && isinscope('Cases'[PrimaryTopic2])
--Must return FALSE on Admin AND return TRUE on Auto (excludes row and grand total)
,DISTINCTCOUNT('Cases'[PrimaryTopic2])
)
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Thank you for this, much appreciated!
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 28 | |
| 27 | |
| 25 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 53 | |
| 46 | |
| 38 | |
| 30 | |
| 21 |