Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I want to count number of days regardless of checking that if data is in database or not. All I want is when user select date range from slicer either days or months or years. It should count the number of days including weekends and just display number of days.
For example :
Number of days = 3
Number of days = 3 * 7 = 21 days
At the moment I get count of days for which data exist in database. Whereas I want to count total number of days selected even if data is not present in database. Thanks
@Anonymous , On you slicer column, try a measure like
measure =
var _max = maxx(ALLSELECTED('Date'),'Date'[Date])
var _min = minx(ALLSELECTED('Date'),'Date'[Date])
return
datediff(_min,_max,day)+1
Thanks! This solution worked for me. I had problems with the function "AVERAGEX(VALUES ....", so I replaced it with your suggestion and it worked.
It's not working when I use the below selection I get Number of days 1 instead of 3 :
Because I don't have data in database for date 13/04/2021 and 14/04/2021. But I want to count number of days regardless of data in database.
@Anonymous , we do not have a way to know other parameters from the relative date slicer. So if dates are not present, I doubt of a way I know.
Please see below screenshots :
Showing that it brings the max date from database instead of getting it from slicer.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |