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
rmeng
Helper II
Helper II

Distinct Count of rows grouped by measure

Hello Guys,

I need a formula for the Count of [HCO] for 3 different tables: HCO, HCO+SECTION and HCO+SECTION+Attribute.

  • HCO table should only count 3 HCO's.
  • HCO+SECTION counts 5 HCO's (combines the distint count of [HCO] and [SECTION]
  • HCO+SECTION+ATTRIBUTE (combines all rows)
 
 

Captura de ecrã 2021-02-12 223909.png

 

 
 

 

 

 

 

 

1 ACCEPTED SOLUTION
jameszhang0805
Resolver IV
Resolver IV

Testing.gif

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Options =
SELECTCOLUMNS(
{ ( 1 , "HCO") ,
( 2 , "HCO+SECTION" ) ,
( 3 , "HCO+SECTION+ATTRIBUTE" )
} ,
"Index" , [Value1] , "Options" , [Value2] )
微信图片_20210216200957.png

View solution in original post

5 REPLIES 5
jameszhang0805
Resolver IV
Resolver IV

Testing.gif

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Options =
SELECTCOLUMNS(
{ ( 1 , "HCO") ,
( 2 , "HCO+SECTION" ) ,
( 3 , "HCO+SECTION+ATTRIBUTE" )
} ,
"Index" , [Value1] , "Options" , [Value2] )
微信图片_20210216200957.png
rfigtree
Resolver III
Resolver III

maybe

mCountHCO:=COUNTROWS(SUMMARIZE(Table1,Table1[HCO]))
mCountHCOandSection:=COUNTROWS(SUMMARIZE(Table1,Table1[HCO],Table1[SECTION]))
mCountHCO&Section&Attribute:=COUNTROWS(SUMMARIZE(Table1,Table1[HCO],Table1[SECTION],Table1[ATTRIBUTE]))

 

Thanks but don´t forget about the average score.

"thanks"!

 

re read your question.

 

I need a formula for the Count of 

 

Sorry, you´re right I  didn´t explain in the best way. So let me rephrase  I need a formula for the count of the HCO like the tables I´ve shown. So the [readiness score] is a part of that tables.

So in the first table, for HCO ="A" I have 8 rows and I need the average of the 8 rows and the count shoulb be = 1 ( Distinct count of HCO="A"). 

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.