Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I have a report that has a date slicer allowing a user to select a date range. I also have a Weekend Flag filter, choices are Weekday, Weekend or All, allowing them to choose which days to include. I need to count the total days dependent on what they pick. I've used this for Total Days, and it works fine, but I don't know how to incorporate in the Weekend filter to only count Weekdays if needed:
Total Days =
VAR FirstDay = CALCULATE(
MIN('Case Details'[Surgery Date]),
ALLSELECTED('Case Details'[Surgery Date])
)
VAR LastDay = CALCULATE(
MAX('Case Details'[Surgery Date]),
ALLSELECTED('Case Details'[Surgery Date])
)
RETURN
CALCULATE((DATEDIFF(FirstDay, LastDay, DAY)) + 1)
Solved! Go to Solution.
@FreemanZ I was able to get it working...I changed it to "IN":
hi @aashton
Supposing you have a qualified Date Table, try like:
Thank you yes, that looks like it will work. But I need the filter do be dependent on what they pick on the Weekend Flag filter, so I can't hardcode it just for weekdays:
hi @aashton
then try like:
@FreemanZ Thank you so much for your help. Sorry one more thing...what if they pick both Weekend and Weekday because they want to see everyday?
hi @aashton
if the user doesn't pick any item in the slicer, the measure shall calculate for everyday.
@FreemanZ Ohhhh...I must have done something wrong, it's not working like that:
hi @aashton
@FreemanZ The Day of the Week is just the title on put on the box, it is the Weekend Flag field....
@FreemanZ I was able to get it working...I changed it to "IN":
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
14 | |
11 | |
8 |
User | Count |
---|---|
24 | |
19 | |
12 | |
11 | |
10 |