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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
wherdzik
Helper III
Helper III

Count Distinct Dates Not working

I thought this would work but I am having a hard time to get the service days graph to work.  Esentially I want to be able to count unique service days.  It should be anywhere around 16 to 20 days as normally that is how many working days are in a month.  I am getting 30 to 40 days?  I am picking the month in the hirearchy and then I am distinct counting the days.  I thought this makes sense but it must be doing something else.  Is it they way its aggregating in the hierarchy that is messing t his up?

wherdzik_1-1698326439797.png

 

My visual

wherdzik_0-1698326304753.png

 

I brought this data source for Janaury and I get 15 days:

wherdzik_2-1698326523555.png

 

9 REPLIES 9
HotChilli
Super User
Super User

Remove the .[Date] part

That does not work...same outcome.

Anonymous
Not applicable

Hi @wherdzik ,

Try unchecking Automatic Date/Time. Then create and use the [Month] column in the date table as the axis.

vcgaomsft_0-1698649350293.png

 

= DISTINCTCOUNTNOBLANK('SEP YTD'[Service Date])

 

 

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

wherdzik
Helper III
Helper III

Is there anyway someone can help me with this one?

HotChilli
Super User
Super User

I think you'll just confuse yourself by going to chatgpt.

--

Do you have multiple years in the data?

This current data is only Calendar Year

wherdzik
Helper III
Helper III

Count Days = DISTINCTCOUNTNOBLANK('SEP YTD'[Service Date].[Date])
HotChilli
Super User
Super User

What is the [Count Days] measure?

I tried Chat GPT and it doesnt like the syntax.

VAR temptable =
    SUMMARIZE (
        FILTER (
            'SEP YTD',
            'SEP YTD'[Service Date] >= FIRSTDATE('SEP YTD'[Service Date]) &&
            'SEP YTD'[Service Date] <= LASTDATE('SEP YTD'[Service Date])
        ),
        'SEP YTD'[Service Date]
    )
RETURN
    COUNTROWS ( temptable )

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors