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
Mahmoodul
Helper I
Helper I

Trying to find the difference between Today count and Previous day count on weekdays

Trend.png

Hi Team,

Trying to find the difference between Today count and Previous day count on weekdays.I am already calculate the difference but problem i am facing here is When it is weekend becuase my report based on Weekdays(monday to Friday).Monday to friday is showing good but on weeknd it is not coming correct becuase weekend date is not available(Suppose friday date is 4thSep and (5th and 6th is weeknd) and 7th is Monday so i wanted my Today date is 7th and previous date is 4th, i want to exclude weekend  in report date.

How can i find the difference between Today and Previous day on weekdays.

Clumn NAME below

reportdate

Sub region

Calls

@Tahreem24 

6 REPLIES 6
Greg_Deckler
Super User
Super User

@Mahmoodul Just to add to @Tahreem24 , there is a Quick Measure Gallery item for this as well. https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Days/m-p/367362#M109



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Tahreem24
Super User
Super User

@Mahmoodul ,

In order to exclude weekend from data so use this method:

  • Add a calculated column  IsWeekend = IF(WEEKDAY(Table1[RepoortingDate])>5,1,0)

  • Filter your visual by IsWeekend is 0 (This will exclude weekend)

  • You can then calculate Count.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Hi Team

6789.png

I am using you above Dax but not getting proper result, if you see the attched image when we select 7th sep I.E Monday(Today Date) and 4th sep i.e Friday(Previous Day), it is not coming.Everyday it is working but When i I select Monday date and Friday date, it is not working.Can you please help me

 

@Tahreem24 

@TomMartens 

@parry2k 

@mwegener

hi  @Mahmoodul 

For this case, you need to add Date field into "Columns", since there is no row context for date, 

7th sep previous is 4th sep, 4th sep previous is 3th sep, if you selected two days, how do you want it show in this matrix visual?

 

so for your case, you could try these two ways:

1. Only select one date in the slicer

2. Drag date field into "Columns" of matrix too.

 

If you still have the problem, please share your sample pbix file, that will be a great help.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Mahmoodul , Create a Rank on week days. refer the steps here

https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calenda...

Work Day = if(WEEKDAY([Date],2)>=6,0,1)
Work Date = if(WEEKDAY([Date],2)>=6,BLANK(),[Date])
Work Date Cont = if([Work Day]=0,maxx(FILTER('Date',[Date]<EARLIER([Date]) && [Work Day]<> EARLIER([Work Day]) ),[Date]),[Date])
Work Date cont Rank = RANKX(ALL('Date'),[Work Date Cont],,ASC,Dense)

 

Work on this day vs last day like

This Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Work Date cont Rank]=max('Date'[Work Date cont Rank])))
Last Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Work Date cont Rank]=max('Date'[Work Date cont Rank])-1))
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

can you please convert this with my given column, I am unable to do it.

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.