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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

How can I filter a table visual on a measure?

I have a measure defined:  StartDate1Y = DATEADD(LASTDATE(GetZeroPBaseData[ProductionDate]),-1,YEAR)
 
I want to filter a table visual based on that measure.  For clarification, a slicer defines my production date range to be, say, May - Jun 2023.  This measure will create a second date range from Jun 2022 to Jun 2023, or rather, just that start date.  Then, I want to apply those dates to an unrelated table visual where that first slicer has been turned off.  I can't get it to work.  I'm new to PowerBI and I'm trying to learn from the middle, but I have to get it figured out by Monday.
 
Thanks in advance for any help.
2 REPLIES 2
danextian
Super User
Super User

Hi @Anonymous ,

 

You can't use a measure in a slicer, only a column can. What you can do  is to reference that measure in another measure to filter a calculation. For example:

New Measure =
CALCULATE (
    [measure or aggregation],
    FILTER ( mytable, mytable[column] = [my filter measure] )
)

If you want to get a better answer, please refer to this sticky post:

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/3332479#M1112153 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
littlemojopuppy
Community Champion
Community Champion

HI @Anonymous 

 

You cannot plug measures into slicers...only columns.

 

I'd suggest building the logic for a given selection of dates, calculate the measure for the intended dates.  You will need a date table and it marked appropriately.  But after that, there are Time Intelligence functions that will make this really easy.

 

Hope this helps!

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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