This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi team,
I need to count people who are compliant with all courses that our company offers to them. Anyone who completes all courses is compliant, others are not.
For example, let's say we have 5 courses for 4 users, and the first three courses are requirements to become compliant. How should I code it?
Sorry, if it's an easy question. I can think of it in an algorithmic way, but not sure how to write it in DAX. Appreciate your suggestions.
Solved! Go to Solution.
First, create a calculated column
Count =
IF ( 'Table'[Course] IN { "C1", "C2", "C2" } && 'Table'[Completed] = "No", 1 )
Then create this measure:
Compliant =
SUMX (
SUMMARIZE (
'Table',
'Table'[Name],
"CountNo",
CALCULATE (
sum('Table'[Count]),
ALLEXCEPT ( 'Table', 'Table'[Name] )
)
),
IF ( [CountNo] = BLANK (), 1 )
)
Thank you @danextian, but it's not working.
It returns Blank.
I was expecting the code to count the YESs and distinct-count every name that is equal to 3 (in this example). With the filter on C4 and C5 that are irrelevant courses.
Hi @Mahdi1366 ,
My understanding is any [Name] that has [Completed] = No is non-compliant so if count of no of a name is blank, should be compliant. The original logic showed the total on a per name basis but not as a whole. Please try this instead.
Compliant =
SUMX (
SUMMARIZE (
'Table',
'Table'[Name],
"CountNo",
CALCULATE (
COUNTROWS ( 'Table' ),
ALLEXCEPT ( 'Table', 'Table'[Name] ),
'Table'[Completed] = "No"
)
),
IF ( [CountNo] = BLANK (), 1 )
)
@danextian You could be right that every [name] with [completed] = No is non-compliant IF there were no irrelevant courses. In the above example, Name A is compliant although A has not completed course C4.
* To be compliant, you only need to complete C1, C2, and C3.
First, create a calculated column
Count =
IF ( 'Table'[Course] IN { "C1", "C2", "C2" } && 'Table'[Completed] = "No", 1 )
Then create this measure:
Compliant =
SUMX (
SUMMARIZE (
'Table',
'Table'[Name],
"CountNo",
CALCULATE (
sum('Table'[Count]),
ALLEXCEPT ( 'Table', 'Table'[Name] )
)
),
IF ( [CountNo] = BLANK (), 1 )
)
Hi @Mahdi1366 ,
Try this:
Compliant =
VAR CountOfNo =
CALCULATE (
COUNTROWS ( 'Table' ),
ALLEXCEPT ( 'Table', 'Table'[Name] ),
'Table'[Completed] = "No"
)
RETURN
CALCULATE (
DISTINCTCOUNT ( 'Table'[Name] ),
FILTER ( 'Table', CountOfNo = BLANK () )
)
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 36 | |
| 30 | |
| 22 | |
| 22 |