Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
KL008
Helper I
Helper I

Help Needed with Power BI Measure to Count Unique Key Controls

 I am working on a Power BI report where I need to count the number of unique key controls. I have two tables: ControlRelations and DimControl.

 

The ControlRelations table contains multiple instances of controls (since it also lists out relations with other dimensions), there is a column called IsKeyControl and it's either True or False. I would like to create a measure that is similar to this:

TotalKeyControls =
CALCULATE(
    COUNTROWS('Historical Controls'),
    'Historical Controls'[IsKeyControl] = TRUE()
)

However, since there are multiple instances of the same control (denoted by the same Guid), it counts 1 key control as 1,2,3,4.....etc. Each control will have the same value for IsKeyControl. So for any Guid = Guid, IsKeyControl = IsKeyControl.

What I am looking for is a measure that will count the number of keycontrols and only count 1 key control per unique Guid. 

Can someone help me out please? Copilot has been of no use to me.

Kind regards

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@KL008 Use DISTINCTCOUNT or COUNTROWS( DISTINCT( SELECTCOLUMS( ... ) ) )



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@KL008 Use DISTINCTCOUNT or COUNTROWS( DISTINCT( SELECTCOLUMS( ... ) ) )



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors