Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

% of month gone

Hi everyone,

 

In one of my MTD reports, I have a card with % of month gone excl. Saturday and Sunday. To do that I have created three measures; Workdays worked, Workdays in month and % of month gone. It works fine but the problem appears when I filter on the slicer, then it shows "(Blank)". The measures will be detailed below:

 

Workdays worked = 

CALCULATE(COUNT('Invoked Function'[WorkingDay]);'Invoked Function'[WorkingDay]="True";'Invoked Function'[MonthOfYear]=MONTH(TODAY());'Invoked Function'[Year]=YEAR(TODAY());'Invoked Function'[Date]<NOW()-1)
 
Workdays in month = 
CALCULATE(COUNTROWS('Invoked Function');'Invoked Function'[WorkingDay]="True";'Invoked Function'[MonthOfYear]=MONTH(TODAY());'Invoked Function'[Year]=YEAR(TODAY()))
 
% of month gone = [Workdays worked]/[Workdays in month]
 
Is there a better or more efficient way to do this? And how can I avoid the "(Blank)"?
 
Thank you 🙂
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @amitchandak , I edited the interactions of the slicer. That worked 🙂

View solution in original post

9 REPLIES 9
Sabeeluzzama
Regular Visitor

You can use MTD. But that will work, but when there is the date selected. Also, use it on the calendar, not on the table

Passed days = CALCULATE(count('Date'[Working day]),DATESMTD('Date'[Date]))

Month days = CALCULATE(count('Date'[Working day]),DATESMTD(endofmonth('Date'[Date])))

amitchandak
Super User
Super User

You can use MTD. But that will work, bets when there is the date selected. Also, use it on the calendar, not on the table

Passed days = CALCULATE(count('Date'[Working day]),DATESMTD('Date'[Date]))

Month days = CALCULATE(count('Date'[Working day]),DATESMTD(endofmonth('Date'[Date])))

 

Check calendar setting in file : https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hi @amitchandak,

 

The report doesn't have any date slicer. It is static but it shouldn't show (Blank) when I, for example, choose a specific team through the slicer.

That will filter, if you use datemtd or totalmtd, along with calendar table.

So either select a date from slicer , or create a calendar till today

 

date = Calendar(date(2017,01,01),today())

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

@amitchandak When I use count then it counts every day in the month, it should only count the workdays. This means it should return 18 in terms of passed days

Yes, you are right. Work day should be sum, because it has 1 and 0 values. If it does not work. Can you share sample data and sample output. If possible please share a sample pbix file after removing sensitive information.Thanks.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hi @amitchandak , I edited the interactions of the slicer. That worked 🙂

Anonymous
Not applicable

You can create a calculated column:

MonthProgress% =
var MonthDays = DAY(
IF(MONTH(Table[date]) = 12,
DATE(YEAR(Table[date]) + 1,1,1),
DATE(YEAR(Table[date]), MONTH(Table[date]) + 1, 1)
) - 1)

return Table[Date].[Day] / MonthDays *100

Anonymous
Not applicable

Hi @Anonymous,

 

This wouldn't work next month? % of month gone should start from zero again automatically next month

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.