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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
jileigh
Helper I
Helper I

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 @jileigh ,

 

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/3332... 






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.
littlemojopuppy
Community Champion
Community Champion

HI @jileigh 

 

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.