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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
DenbyG
Frequent Visitor

Distinct Count

Hi, I would like to do a distinct count of all the items in a coloumn 'LAR' that is ZPROG001, and all the items in another column, 'AES' that is 10 or 11, in Power Bi. I've tried several different DAX's but I can't seem to get it to work. I'm learning DAX so would appreciate some support.

1 ACCEPTED SOLUTION

Brilliant. Thank you. I appreciate that. It is CountRows.

View solution in original post

4 REPLIES 4
Shai_Karmani
Solution Sage
Solution Sage

You can do this with a simple CALCULATE+ DISTINCTCOUNT.

If you want the distinct count of rows where LAR = "ZPROG001" and AES = 10 or 11, try:

meas_Count_LAR_AES =
CALCULATE(
DISTINCTCOUNT(YourTable[YourRowID]),
YourTable[LAR] = "ZPROG001",
YourTable[AES] IN { 10, 11 }
)

 

Replace YourTable with your table name and YourRowID with a unique row column.

If LAR is already unique per row, you can also distinct-count LAR directly:

meas_Count_LAR_AES =
CALCULATE(
DISTINCTCOUNT(YourTable[LAR]),
YourTable[LAR] = "ZPROG001",
YourTable[AES] IN { 10, 11 }
)

 
 

Shai Karmani | Data & Analytics

If it helped  please mark as resolved & give a kudo so others can find it too.

Let’s connect on LinkedIn

Hi, Sorry but it just returns a value of 1. I know there are more than that

Learning aim reference
ZPROG001
Z0059747
ZPROG001
Z0059747
ZPROG001
ZPROG001
ZPROG001
ZPROG001
ZPROG001
ZPROG001
Z0059747
ZPROG001
ZPROG001
Z0059747
ZPROG001
Applicable employment status
11
0
11
0
2
10
10
10
11
10
0
11
10
0
1
 
   
   
   
   
   
   
   
   

Would you want to count unique items or all items? If it is a distinct count, the Measure should be all good. If you would want to count all rows that meet the conditions, then change the DISTINCTCOUNT() to COUNTROWS('table'). 

Brilliant. Thank you. I appreciate that. It is CountRows.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.