Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I am trying to add a rotating tile which displays Number of days in current month remaining and i got it to work using
Hi @Anonymous
Hi @Anonymous
If Watsky's reply solve your problem, please accept it as a solution so others may find it quickly.
If not, please refer to my solution.
Create measures
TODAY = TODAY() TOTAL DAYS THIS MONTH = CALCULATE(COUNT(Dates_Dim[day]),FILTER(ALL(Dates_Dim),Dates_Dim[year]=YEAR([TODAY])&&Dates_Dim[month]=MONTH([TODAY]))) REMAING DAYS = CALCULATE(COUNT(Dates_Dim[day]),FILTER(ALL(Dates_Dim),Dates_Dim[year]=YEAR([TODAY])&&Dates_Dim[month]=MONTH([TODAY])&&Dates_Dim[Date]>[TODAY])) % = [REMAING DAYS]/[TOTAL DAYS THIS MONTH]
If we change [Today] measure as below
TODAY = DATE(2019,10,7)
See if this works:
First add a new column to your Date table:
WorkDay = IF(WEEKDAY(Dates_Dim[Date],2)<6,1,0)
Then try this measure:
Workdays Passed in Month AS Percent =
VAR ThisToday = TODAY()
VAR ThisMonthStart = DATE(year(ThisToday),MONTH(ThisToday),1)
VAR EOM = EOMONTH(ThisMonthStart,0)
VAR BIZWEEK = MOD(
5 + WEEKDAY(
TODAY() + 1) -
WEEKDAY(EOMONTH(TODAY(),0)-1),
5)
VAR TotalWorkDaysInMonth = CALCULATE(
SUM(Dates_Dim[Workdday])
,ALL(Dates_Dim)
, DATESBETWEEN(Dates_Dim[Date],ThisMonthStart,EOM)
)
RETURN
DIVIDE(TotalWorkDaysInMonth - BIZWEEK,TotalWorkDaysInMonth)This returned 83% for me. Let me know if that worked for you.
Proud to be a Super User!
I tweaked yours
First add a new column to your Date table:
WorkDay = IF(WEEKDAY(Dates_Dim[Date],1)<8,1,0)
Then try this measure:
Workdays Passed in Month AS Percent =
VAR ThisToday = TODAY()
VAR ThisMonthStart = DATE(year(ThisToday),MONTH(ThisToday),1)
VAR EOM = EOMONTH(ThisMonthStart,0)
VAR BIZWEEK = MOD(
7 + WEEKDAY(
TODAY() + 1) -
WEEKDAY(EOMONTH(TODAY(),0)-1),
7)
VAR TotalWorkDaysInMonth = CALCULATE(
SUM(Dates_Dim[Workdday])
,ALL(Dates_Dim)
, DATESBETWEEN(Dates_Dim[Date],ThisMonthStart,EOM)
)
RETURN
DIVIDE(TotalWorkDaysInMonth - BIZWEEK,TotalWorkDaysInMonth)It worked. But when i selected September it still shows values for current month. For september it should say days remaining as 0 and % as 100%
Any help on this?
@Anonymous I changed all the Today() to the date range instead. Give this a shot.
Workdays Passed in Month AS Percent =
VAR ThisToday = TODAY()
VAR ThisMonthStart = STARTOFMONTH(Dates_Dim[Date])
VAR ThisMonthEnd = ENDOFMONTH(Dates_Dim[Date])
VAR BIZWEEK = MOD(
5 + WEEKDAY(
ThisMonthStart+ 1,1) -
WEEKDAY(ThisMonthEnd,1)-1,
5)
VAR TotalWorkDaysInMonth = CALCULATE(
SUM(Dates_Dim[Workdday])
,ALL(Dates_Dim)
, DATESBETWEEN(Dates_Dim[Date],ThisMonthStart,ThisMonthEnd)
)
RETURN
IF(MONTH(ThisMonthEnd)=MONTH(ThisToday), DIVIDE(TotalWorkDaysInMonth-BIZWEEK,TotalWorkDaysInMonth),1)
Proud to be a Super User!
@Watsky I used below and it is returning 84%. Value should be 77.4%
Not sure how you get 77.4% the best I could come up with is 77.27%
% Workdays Passed in Month =
VAR ThisToday = TODAY()
VAR ThisMonthStart = STARTOFMONTH('Dates_Dim'[Date])
VAR ThisMonthEnd = ENDOFMONTH('Dates_Dim'[Date])
VAR BIZWEEK = MOD(
7 + WEEKDAY(
ThisMonthStart,1) -
WEEKDAY(ThisMonthEnd,1),
7)
VAR TotalWorkDaysInMonth = CALCULATE(
SUM(Dates_Dim[Workdday])
,ALL('Dates_Dim')
, DATESBETWEEN('Dates_Dim'[Date],(ThisMonthStart),(ThisMonthEnd)-1)
)
RETURN
IF(MONTH(ThisMonthEnd)=MONTH(ThisToday), DIVIDE((TotalWorkDaysInMonth-BIZWEEK),TotalWorkDaysInMonth),1)
Proud to be a Super User!
I'm not sure why but yours is returning different than mine.
Proud to be a Super User!
@Anonymous I'm still looking in to it.
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |