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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
abodqm
Regular Visitor

i want to count distinct count in some way is it possible

i have lets say 5 centers in monthly basis with data about clients and some of them doesnt appear in some months i want to count them and put them in a table to know which centers of those doesnt have any data in that month and ofcourse i have to count them as distinct can i do this ? im a beginner in dax and power bi 

 

Ex. centers
alquds center
alsuwaidi center
alarid center
alhilal center
alrabwah center

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @abodqm ,

Suppose we have:

vcgaomsft_1-1703584262699.png
Please try like:

Measure = 
VAR _cur_month_number = SELECTEDVALUE('Table'[Month])
VAR _centers_before = CALCULATETABLE(VALUES('Table'[centers]),'Table'[Month]<_cur_month_number)
VAR _result = IF(ISBLANK(_cur_month_number),"Please choose a month",CALCULATE(DISTINCTCOUNT('Table'[centers]),NOT 'Table'[centers] IN _centers_before))
RETURN
_result

Output:

vcgaomsft_0-1703584237171.png

check the pbix file.

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




abodqm_0-1703052192556.png

 

look here 5 centers in feb second photo there is one center how do i know the rest that doesn't have any data in a list can i do somthing to make them in every month show me the one's with no data 

abodqm_1-1703052192557.png

 

 

@abodqm 

pls try 

DISTINCTCOUNT(centers)

DISTINCTCOUNT function (DAX) - DAX | Microsoft Learn





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




bro i am using distinct count 

Anonymous
Not applicable

Hi @abodqm ,

Suppose we have:

vcgaomsft_1-1703584262699.png
Please try like:

Measure = 
VAR _cur_month_number = SELECTEDVALUE('Table'[Month])
VAR _centers_before = CALCULATETABLE(VALUES('Table'[centers]),'Table'[Month]<_cur_month_number)
VAR _result = IF(ISBLANK(_cur_month_number),"Please choose a month",CALCULATE(DISTINCTCOUNT('Table'[centers]),NOT 'Table'[centers] IN _centers_before))
RETURN
_result

Output:

vcgaomsft_0-1703584237171.png

check the pbix file.

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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