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
laehatlav
Frequent Visitor

calculate measure the number of days from a single date column between two date

Hello,

I am a beginner to Power Bi. Can anyone help me  calculate a measure to determine the number of days from a single date column between two dates. Here is a picture of my spreadsheet i have on my power bi desktop.  the result of the number of days will be used to multiply to the amount budget per day. Example, caluculate no. of days between 12/09/2019 and 12/24/2019. Thank you!

 

calculate number of days bewteen datecalculate number of days bewteen date

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @laehatlav,

According to your description, it sounds like you want to get the date count that existed in your table and in a specific date range?

If this is a case, you can try to use the following measure formula if meets for your requirement:

Measure =
VAR selected =
    ALLSELECTED ( Calendar[Date] )
RETURN
    CALCULATE (
        COUNTROWS ( VALUES ( Table[gldate] ) ),
        FILTER ( ALLSELECTED ( Table ), [gldate] IN selected )
    )

In addition, if you only want to calculate the day count of the specific date range you can consider to use DATEDIFF or COUNTROWS with calendar function:

Measure =
COUNTROWS ( CALENDAR ( MIN ( Calendar[Date] ), MAX ( Calendar[Date] ) ) )

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @laehatlav,

According to your description, it sounds like you want to get the date count that existed in your table and in a specific date range?

If this is a case, you can try to use the following measure formula if meets for your requirement:

Measure =
VAR selected =
    ALLSELECTED ( Calendar[Date] )
RETURN
    CALCULATE (
        COUNTROWS ( VALUES ( Table[gldate] ) ),
        FILTER ( ALLSELECTED ( Table ), [gldate] IN selected )
    )

In addition, if you only want to calculate the day count of the specific date range you can consider to use DATEDIFF or COUNTROWS with calendar function:

Measure =
COUNTROWS ( CALENDAR ( MIN ( Calendar[Date] ), MAX ( Calendar[Date] ) ) )

Regards,

Xiaoxin Sheng

JarroVGIT
Resident Rockstar
Resident Rockstar

To calculate the days between two dates, you can use DATEDIFF(<startdate>, <enddate>, DAYS). In your case something like 

Measure = DATEDIFF(MIN(Table[gldate]), MAX(Table[gldate]), DAYS)

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





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

Proud to be a Super User!




Anonymous
Not applicable

DATEDIFF() should be able to accomplish this for you!

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