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
writetofaiz
Helper I
Helper I

DAX formula incorrect result of Number of Appointments

Hi,
Below is the result I am getting in Power BI report. For Number of Appointments Booked, I have used the formula:

Number of Appointments Booked = COUNT('fact'[appt_date]). For BT, I am getting value of 6, but the correct value is 1. Similarly for Exam Emergency, I am getting 11, but the correct value is 1. I can use DistinctCount instead of Count to get the correct result but I don't want to use that. Is there a way to count the records on selected columns in DAX like the one we get in SQL
Select dim_practice_key, dim_clinician_key,count(*) from table
group by dim_practice_key, dim_clinician_key

 

r1.png

result.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from @lbendlin , please allow me to provide another insight: 

 

Hi  @writetofaiz ,

You can try the following measure:

Test =
var _table1=
SUMMARIZE('Table',[appt_service_description],[dim_clinician_key],[dim_practice_key])
return
COUNTX(
    _table1 ,[appt_service_description])

vyangliumsft_0-1719472582342.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from @lbendlin , please allow me to provide another insight: 

 

Hi  @writetofaiz ,

You can try the following measure:

Test =
var _table1=
SUMMARIZE('Table',[appt_service_description],[dim_clinician_key],[dim_practice_key])
return
COUNTX(
    _table1 ,[appt_service_description])

vyangliumsft_0-1719472582342.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Looks like you want to use DISTINCTCOUNT() rather than COUNT()

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.

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.