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! Learn more

Reply
nandukrishnavs
Community Champion
Community Champion

Unique days in the specified range

Hi Everyone,

 

I have a table as specified in the below screenshot. I'm trying to calculate total unique days in the date range.

nandukrishnavs_1-1676379056214.png

 

In this example, expect output is 30

 

nandukrishnavs_2-1676379329428.png

How can we do it in DAX? This calculation needs to happen dynamically and the result will be used in remaining calculations. Hence PowerQuery solution is not suitable. 

 

 


Regards,
Nandu Krishna

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @nandukrishnavs 
This shall give you the desired result at the total level or in a card visual. Please refer to attached sample file.

1.png

unique days = 
COUNTROWS (
    DISTINCT (
        SELECTCOLUMNS ( 
            GENERATE (
                'Table',
                CALENDAR ( 'Table'[start date], 'Table'[end date] )
            ),
            "@Days", [Date]
        )
    )
)

View solution in original post

2 REPLIES 2
nandukrishnavs
Community Champion
Community Champion

Awesome! Thank you @tamerj1  


Regards,
Nandu Krishna

tamerj1
Super User
Super User

Hi @nandukrishnavs 
This shall give you the desired result at the total level or in a card visual. Please refer to attached sample file.

1.png

unique days = 
COUNTROWS (
    DISTINCT (
        SELECTCOLUMNS ( 
            GENERATE (
                'Table',
                CALENDAR ( 'Table'[start date], 'Table'[end date] )
            ),
            "@Days", [Date]
        )
    )
)

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.