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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KP-PowerBI
Frequent Visitor

Month Slicer Filtering with two tables using different comparisons

Hi All

 

I'm trying to figure out how I would use one slicer which has a single select list of month-year to be able to filter on two tables using different comparisons.

 

So for example on Table 1 the data is month-year only, so I want the comparison to be equal to the slicer. But on Table 2 I want it be equal or earlier than the last date of the selected month-year on the slicer.

 

Hope that makes sense.

 

Is that possible?

 

Thanks in advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@KP-PowerBI 

 

Try solution mentioned in this file.

 

https://www.dropbox.com/s/4v9886q51bhenmv/Month%20Slicer%20Filtering%20with%20two%20tables%20using%2...

 

You can edit the formula based on your Month-Year format.


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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@KP-PowerBI 

 

Try solution mentioned in this file.

 

https://www.dropbox.com/s/4v9886q51bhenmv/Month%20Slicer%20Filtering%20with%20two%20tables%20using%2...

 

You can edit the formula based on your Month-Year format.


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

Thanks for this it helped a lot and got me in the right direction.

 

For anyone reading this thread what I did was created a MonthTable, with MonthName and Year and a calculated column to work out the MonthEndDate from that. I then created two measures in my MonthTable with a filter check on the field I am using as a slicer. One for 'MonthNameYear' and one for 'MonthEndDate'. The formula for MonthEndDate is as follows (similar for MonthNameYear):

 

SelectedMonthEndDate = IF(ISFILTERED(MonthTable[MonthName-Year]),FIRSTNONBLANK(MonthTable[MonthEndDate],1),BLANK())

 

 

Then for the table with Monthly Data I created a measure with a filter based on the selection of the MonthTable Slicer.

 

SumTarget= CALCULATE(SUM('MonthlyData'[Target]), FILTER('MonthlyData', MonthlyData'[MonthName Year] = MonthTable[SelectedMonthNameYear]))

 

 

Then for the table with actual dated data I created a similar measure but using a date comparison

 

ScoreTarget = CALCULATE(DIVIDE('FullData'[TotalOnTarget] + 0,[Total] + 0),FILTER('FullData', 'FullData'[targetdate] <= MonthTable[SelectedMonthEndDate]))

 

 

Hope that helps.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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