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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
joshua1990
Post Prodigy
Post Prodigy

Show next 7 weeks based on Selection

Hi all!

I hve a simple sales table that is linked to a calendar table.

Now I would like to create a report (matrix visual) that shows me per article (row) the sales per week (column) based on week selection.

If I select WK01, then I would like to see it this way:

Article WK01 WK02 WK03 WK04 WK05
A 1 3 0 4 3
B 1 3 0 4 4
C 1 3 0 44 4
D 1 3 0 9 3
E 1 0 0 9 5

 

How would you do that?

Do I need a second calendar table ?

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

I would utilize a filter measure:

E.g. this measure shows the next 11 weeks:

11weeks = var _sdate =CALCULATE(MIN('Calendar'[Date]),ALL('Calendar'[Date]),
WEEKDAY('Calendar'[Date],2)=1,
WEEKNUM(TODAY())=WEEKNUM('Calendar'[Date]),
'Calendar'[Date]>TODAY()-7)

var _edate = _sdate + 7*11
var cdate = MAX('Calendar'[Date])
return
IF(cdate>=_sdate&& cdate<=_edate,1,0)

You can make the measure to be dynamic by using another calendar and then referencig that in the dax.

End result:

ValtteriN_0-1668358820674.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/








Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ValtteriN
Super User
Super User

Hi,

I would utilize a filter measure:

E.g. this measure shows the next 11 weeks:

11weeks = var _sdate =CALCULATE(MIN('Calendar'[Date]),ALL('Calendar'[Date]),
WEEKDAY('Calendar'[Date],2)=1,
WEEKNUM(TODAY())=WEEKNUM('Calendar'[Date]),
'Calendar'[Date]>TODAY()-7)

var _edate = _sdate + 7*11
var cdate = MAX('Calendar'[Date])
return
IF(cdate>=_sdate&& cdate<=_edate,1,0)

You can make the measure to be dynamic by using another calendar and then referencig that in the dax.

End result:

ValtteriN_0-1668358820674.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/








Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.