cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## How to show last 10 Monday/Tuesday sales based on the WeekNum and WeekDay Selected from Slicer

Team,

I have a challenge I have 2 tables Cal_Table and Sales_Table.

I have to calculate last 10 days weekdays sales based on the WeekNumber selected from the slicer.

Slicer 1 - WeekNum Slicer 2 - WeekDay

Now if the user select week 10 and Tuesday, I have to show last 10 Tuesdays Slaes.

Pelase help me

Thanks !

Rakesh

3 REPLIES 3
Super User

@Rakeshss , I would first like you to create a week Rank column in a date tbale and have week number and week day from that table in slicer

Have these new columns in Date Table, Week Rank is Important in Date/Week Table

Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format

These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))

Last 10  weeks = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]>=max('Date'[Week Rank])-9 && 'Date'[Week Rank]<=max('Date'[Week Rank])   && 'Date'[WeekDay] = Max('Date'[WeekDay] ) ))

Frequent Visitor

The abouve measure is not working correctly.

Thanks!

Frequent Visitor

I am working with DirectQuery Mode.

I need to show the Output as below.

User will select week from Slicer and Day from other slicer it should only show that day value for last 10 weeks.

Thanks !

Rakesh

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.