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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Rakeshss
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
amitchandak
Super User
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] ) ))

@amitchandak 

Thanks fror your response !

The abouve measure is not working correctly.

 

Thanks!

 

@amitchandak ,

 

Thanks for your replay,

I am working with DirectQuery Mode.

Please help me.

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.

Rakeshss_0-1709284299746.png

 

 

Thanks !

Rakesh

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.