Forum Discussion

telesnate's avatar
telesnate
Regular Visitor
1 year ago
Solved

Relative Date Slicer (Skipping Weekends)

Hi there, 

 

I have a report with data that is only created on weekdays. I have no weekend data whatsoever.

 

I have a relative date slicer and when I set it to "last 1 day", I want it to show me the "last 1 weekday" instead, essentially skipping over weekends as if they don't exist.

So on a Monday, "last 1 day" would show me Friday. If I selected "last 2 days" on a Tuesday, it would show me both Monday and last Friday's data. 

 

All the solutions I've looked at regarding this are focused on excluding weekend data. I don't have weekend data. I just want the slicer to skip over weekends and show me the "last x WEEKdays".

 

Many thanks in advance,

 

N

  • I would create a flag on my data table that identified the last date.  If your fact table does not have data at all on the weekends and thus you want to show the most recent weekday with data

     

    Flag_Day_Prior = IF('Date_Table'[Date] = MAX(Fact_Table[Date]),1,0)

     

    Add this field to your measure as a filter and set it = 1

     

    Please mark this post as solution if it helps you. Appreciate Kudos.

5 Replies

  • I would create a flag on my data table that identified the last date.  If your fact table does not have data at all on the weekends and thus you want to show the most recent weekday with data

     

    Flag_Day_Prior = IF('Date_Table'[Date] = MAX(Fact_Table[Date]),1,0)

     

    Add this field to your measure as a filter and set it = 1

     

    Please mark this post as solution if it helps you. Appreciate Kudos.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi telesnate ,

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi telesnate ,

    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

    Thank you.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi telesnate ,

    I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.

    Thank you.