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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Frequent Visitor

Data depending on the weekday



I want to create a report which shows data and depend on the acutal type of day (weekday).

If it is monday, then show the data from friday, and if it is thuesday-friday then show the data from the previous day. 


I have 2 table connected with another, calendar table.

I write dax formula 

like this:


which show me the date depend on the weekday


but in another table it looks like this



If you notice, the last date in first table is 31.03.203, and in second table 03.04.2023.


In results i need to divide column 'lookup scrap' by 'lookup product' so i need to have the same date.


If i choosing the last date then i have another date...  but in monday (03.04.2023) i need to show data from friday (31.03.2023).


This date coming from sql database so i cannot edit this to have the same date in each table. 


Im trying to resolve this like this:



but of course i have data to production not scrap because in scrap the last date is 31.03...


Im not sure if i explain this well  but i hope so...


Pls help 😞


Super User
Super User

why is there a difference in the date? how do you know they belong to the same transaction?  


what is your purpose, can you explain the business requirement.    there are several functions you can use but in order to find the best solution, i need to understand the business rule of how to join the tables to do the divide.

If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!

The data came from some web.pages, 

Its general production company.. 

in the morning when we starting production the machine sending some signals, and we have data for new day(production tabl), 

but the date from second table occured (or not) if we have some scrap in prodution and they add this manually. So the new day ocurred if the fulfill the table in web, some maybe later in the day

So i cant not interfere in this table.. 

Helpful resources

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.