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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
SonyaNadesan
Regular Visitor

Power BI/DAX - How can we apply a filter to another visual on the same page?

I have a matrix which shows data for the selected Year/Month. This selection is made by the user via a drop-down. Data is show for each date of the month (columns).

 

I also have a second visual - a matrix, which shows data for the previous EndOfMonth.

 

For example, if the user selects December 2024, the first visual would show data for every day of this month. The second matrix should show data for November 30th 2024 (previous end of month).

 

The filter works for the first visual but how can I retrieve the user's selected date to calculate the date for the second visual?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you johnt75 

Hi, @SonyaNadesan 

Based on your description, I've created the following measure:

Measure = CALCULATE(SUM('Table'[Value]),DATEADD('DateTable'[Date],-1,MONTH))

Use it to create a visual as follows:

vjianpengmsft_0-1737525138712.png

vjianpengmsft_1-1737525159764.png

The results are as follows:

vjianpengmsft_2-1737525289043.png

 

Best Regards

Jianpeng Li

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

3 REPLIES 3
Anonymous
Not applicable

Thank you johnt75 

Hi, @SonyaNadesan 

Based on your description, I've created the following measure:

Measure = CALCULATE(SUM('Table'[Value]),DATEADD('DateTable'[Date],-1,MONTH))

Use it to create a visual as follows:

vjianpengmsft_0-1737525138712.png

vjianpengmsft_1-1737525159764.png

The results are as follows:

vjianpengmsft_2-1737525289043.png

 

Best Regards

Jianpeng Li

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

 

 

 

Thanks for your response!

 

However, I can't drop a measure into the columns section of the matrix. Any ideas why?

johnt75
Super User
Super User

I think the simplest way would be to create a calculation group with a calculation item using the below DAX.

Prev End of Month =
VAR ReferenceDate =
    MAX ( 'Date'[Date] )
VAR PrevEndOfMonth =
    EOMONTH ( ReferenceDate, -1 )
VAR Result =
    CALCULATE ( SELECTEDMEASURE (), TREATAS ( { PrevEndOfMonth }, 'Date'[Date] ) )
RETURN
    Result

Apply the calculation group as a filter on the second matrix, and select the calculation item. This will then calculate any measure you put into the matrix as at the end of the previous month.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors