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.
My objective is to calculate the number of working days up until yesterday for the current month.
The below measure is working in the Desktop version. However, once it is published not calculating in the Web version.
dimCalendar is a table in PowerBI. IsCurrentMonth and IsWeekDay are columns in the dimCalendar table.
CurrentMonthworkingDays =
CALCULATE (
COUNTROWS (dimCalendar),
FILTER (
dimCalendar,
dimCalendar[Day] <= DAY ( TODAY ()-1 )
&& dimCalendar[IsCurrentMonth]=1
&& dimCalendar[IsWeekDay]="True"))
Solved! Go to Solution.
@ThusiHettigama Try using a VAR then.
VAR __Day = DAY(UTCTODAY()-1)
RETURN
COUNTROWS(...)
@ThusiHettigama Maybe try UTCTODAY instead of TODAY?
UTCTODAY function (DAX) - DAX | Microsoft Docs
Greg, Thanks for suggesting a solution for my issue. However after using UTCTODAY function, the issue is still occuring
@ThusiHettigama Hmm, try placing a simple measure like Measure = TODAY() into a Card visualization and see if you get a different value based upon the Desktop or the Service. Wondering if you need to do some kind of TZ conversion.
Measure = DAY(UTCTODAY()-1) is working in the Desktop version and the Service. However when I add COUNTROWS to calculate number of working days from first day of the current month to DAY(UTCTODAY()-1) it's breaking in the Service (published version)
@ThusiHettigama Try using a VAR then.
VAR __Day = DAY(UTCTODAY()-1)
RETURN
COUNTROWS(...)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |