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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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