Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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 date
Solved! Go to Solution.
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
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
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! 🙂
Proud to be a Super User!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 50 | |
| 43 |