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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.