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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Fcoatis
Post Patron
Post Patron

Matrix Rows Based on Date Slicer

Hello community,

 

Is it possible to have a date slicer dynamically changing a Matrix rows?

 

For instance: if min date of slicer is 28/nov/18 (today) Matrix rows should displays all days of last week. 

 

Sample : https://drive.google.com/open?id=1CzKayMIk99I3JJ4qH7mhEILIuW3nF4Ns

 

Thanks in advance

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Fcoatis

To workaround this,

1.create a new table as a new calnedar table used in slicer.

enter in "New Table"
slicer table = CALENDAR("01/01/18","12/31/18")

Create calculated columns in this table
Weeknum = WEEKNUM([Date],2)
2. add 'slicer table'[date] in the slicer instead of Calendar[date].
create measures in  'slicer table'
min selected = MIN('slicer table'[Date])

weeknum_selected = WEEKNUM([min selected])

weeknum_selected-1 = WEEKNUM([min selected])-1

LastWholeWeek = IF(MAX('Calendar'[Weeknum])=WEEKNUM([min selected])-1,1,0)
3. add in Visual level filter as below
12.png
 
Finally, 
11.png
 
Please see my solution in Page5
 
Best Reagrds
Maggie

View solution in original post

6 REPLIES 6
v-juanli-msft
Community Support
Community Support

Hi @Fcoatis

To workaround this,

1.create a new table as a new calnedar table used in slicer.

enter in "New Table"
slicer table = CALENDAR("01/01/18","12/31/18")

Create calculated columns in this table
Weeknum = WEEKNUM([Date],2)
2. add 'slicer table'[date] in the slicer instead of Calendar[date].
create measures in  'slicer table'
min selected = MIN('slicer table'[Date])

weeknum_selected = WEEKNUM([min selected])

weeknum_selected-1 = WEEKNUM([min selected])-1

LastWholeWeek = IF(MAX('Calendar'[Weeknum])=WEEKNUM([min selected])-1,1,0)
3. add in Visual level filter as below
12.png
 
Finally, 
11.png
 
Please see my solution in Page5
 
Best Reagrds
Maggie

Thank you Maggie,

 

That´s what I was trying to figure out.

 

Kind regards.

 

Fabio Coatis

Just for those interested in my adaptation of Maggie´s solution, I´m sharing the knowledge.

 

Thank you guys.

 

https://drive.google.com/open?id=1MnQ5HzmCs37oK3oXbNM13kiQOW-R2H_6

 

mwegener
Most Valuable Professional
Most Valuable Professional

Hi,

 

I think you can use a relative date slicer for this.

 

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Thanks for the suggestion,

 

but I have a Visual that depends on current date slicer filter, I wanted the other one (Matrix) to dynamicaly change rows.

 

Best regards

mwegener
Most Valuable Professional
Most Valuable Professional

Hi,

i think you have to think different. 🙂

The date slicer filters on page level and should return the date range.

The more granular filter for the visual, you should set on the visual level.  (Maybe with a Top filter on Date.)

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.