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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
paz_23
Regular Visitor

COUNTX (Column with multiple duplicate values)

Hi, 

I am still very new to DAX and I am currently trying to get better with the formulas. My questions is that I have a column [Reference Numbers ] that has various duplicates due to itemization but on the below table I want it to tell me the disitinct reference numbers for the locations for 2021 and 2022. Below are the formula that I currently have but as seen I am getting a result of 902 for 2021 when it should be 395. All help is appreciated! 

 

Screenshot 2023-01-31 104718.png

1 ACCEPTED SOLUTION
olgad
Super User
Super User

Calculate( DISTINCTCOUNT('ClaimsData'[Reference Number]), Filter('ClaimsData', 'ClaimsData'[Year]=2021))

It would be great if you were using a separate data table thats a basis of any report.
Here you can read more on that https://learn.microsoft.com/en-us/dax/calendar-function-dax

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

View solution in original post

2 REPLIES 2
olgad
Super User
Super User

Please kindly accept the solution since it worked for you. Thank you


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime
olgad
Super User
Super User

Calculate( DISTINCTCOUNT('ClaimsData'[Reference Number]), Filter('ClaimsData', 'ClaimsData'[Year]=2021))

It would be great if you were using a separate data table thats a basis of any report.
Here you can read more on that https://learn.microsoft.com/en-us/dax/calendar-function-dax

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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