Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Data depending on the weekday

Hello,

 

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 😞

 

3 Replies

  • vanessafvg's avatar
    vanessafvg
    Icon for Community Champion rankCommunity Champion

    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.

    • Anonymous's avatar
      Anonymous
      Not applicable

      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..