cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
luizronsani Visitor
Visitor

Filter a visual based in the main filter

Hello,

 

Brief explanation: my report is based in weeks, which means the main filter is a week number that filter all data related to the dates in that specific week (ex: week 3 is from 14/01/2019 to 20/01/2019).

 

There is one visual that I show the data for the selected week, however, I need to show the previous 2 weeks in other 2 visuals. In this example, If I select week 3, another visual needs to filter week 2 and another visual week 1.

 

Couldn't attach an image here, so you can see in this link:

https://1drv.ms/u/s!AtzbRaYN5HqYgpto11TGN5drh62h_g

The visual in the right is showing data for a selected week, with this, the visuals in the left must show results for week -1 and -2.

 

Really appreciate any help here

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter a visual based in the main filter

hi, @luizronsani 

For your case, Just create two measure for it as below:

Last week = CALCULATE(SUM('Table'[Value]),FILTER (ALL ( 'Date' ),'Date'[Year]=MAX('Date'[Year])&&'Date'[WEEKNUM]=MAX('Date'[WEEKNUM])-1))
Last 2 week = CALCULATE(SUM('Table'[Value]),FILTER (ALL ( 'Date' ),'Date'[Year]=MAX('Date'[Year])&&'Date'[WEEKNUM]=MAX('Date'[WEEKNUM])-2))

Result:

6.JPG

and here is sample pbix file, please try it.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Filter a visual based in the main filter

hi, @luizronsani 

For your case, Just create two measure for it as below:

Last week = CALCULATE(SUM('Table'[Value]),FILTER (ALL ( 'Date' ),'Date'[Year]=MAX('Date'[Year])&&'Date'[WEEKNUM]=MAX('Date'[WEEKNUM])-1))
Last 2 week = CALCULATE(SUM('Table'[Value]),FILTER (ALL ( 'Date' ),'Date'[Year]=MAX('Date'[Year])&&'Date'[WEEKNUM]=MAX('Date'[WEEKNUM])-2))

Result:

6.JPG

and here is sample pbix file, please try it.

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 5 members 3,053 guests
Please welcome our newest community members: