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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
mgaut341
Frequent Visitor

Counting based on specific value

I created a date difference column to look at the difference when an appt is scheduled to the appt date. I am interested in the appts that are scheduled the same day (date difference =0).
 
When I try to create a visual to count the date difference to be 0 it is not accurate. 
 
I have tried the following formulas:
 
 
# appts schd same day =
COUNTROWS(FILTER('New Appointment_Fact','New Appointment_Fact'[Scheduling Days]=0))
 
and 
 
# appts schd same day =
CALCULATE(
    COUNT('New Appointment_Fact'[Scheduling Days]),
    FILTER('New Appointment_Fact','New Appointment_Fact'[Scheduling Days]=0))
 
Any ideas on what I am doing incorrectly?
1 ACCEPTED SOLUTION
v-kongfanf-msft
Community Support
Community Support

Hi @mgaut341 ,

 

You can try formula like below:

sameday = CALCULATE(COUNTROWS('Table'),'Table'[Scheduling Days] = 0)

vkongfanfmsft_0-1730877369342.png

If the problem persists, please provide relevant test data and describe it.

 

Best Regards,
Adamk Kong

 

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

4 REPLIES 4
v-kongfanf-msft
Community Support
Community Support

Hi @mgaut341 ,

 

You can try formula like below:

sameday = CALCULATE(COUNTROWS('Table'),'Table'[Scheduling Days] = 0)

vkongfanfmsft_0-1730877369342.png

If the problem persists, please provide relevant test data and describe it.

 

Best Regards,
Adamk Kong

 

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

 

yes, that did work!

However I now run into another problem

I want to know the percentage of appts scheduled the same day, but I get a circular dependency.

mgaut341_0-1730905807462.png

Do you know how to fix this?

PijushRoy
Super User
Super User

Hi @mgaut341 

Can you please try the below DAX?

Appts_Schd_Same_Day = 
CALCULATE(
    COUNTROWS('New Appointment_Fact'),
    FILTER(
        'New Appointment_Fact',
        'New Appointment_Fact'[Scheduling Days] = 0
    )
)

 Please let me know if not works 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Unfortunately, it still doesn't work

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.