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
GKJARC
Resolver I
Resolver I

Showing rows in table visual depending on selected date range

Hi!

 

In a table visual, I'm trying to show only the rows where there is an overlap between the ValidFrom to ValidTo, and the selected date range.
The Date in the date range slicer comes form an unrelated calendar table.

 

GKJARC_1-1642523831957.png

 

So with the above selected date range, only the rows marked here as '1' should appear in the table visual in Power BI:

 

GKJARC_2-1642524295451.png

 

The first 4 columns all come from a single table.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@GKJARC , Try a measure like

Measure =
VAR _min = MINX(allselected(Dates) ,Dates[Date])
VAR _max = MAXX(allselected(Dates) ,Dates[Date])
return
if(max(Table[Valid From]) <= _max && max(Table[Valid To]) >=_min , 1,0)+0

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@GKJARC , Try a measure like

Measure =
VAR _min = MINX(allselected(Dates) ,Dates[Date])
VAR _max = MAXX(allselected(Dates) ,Dates[Date])
return
if(max(Table[Valid From]) <= _max && max(Table[Valid To]) >=_min , 1,0)+0

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks @amitchandak , that seems to work!
I used SWITCH-statements intstead of IF-statement hoping to improve performance since I have 3 conditions, and the table visual that this measure applies to is relatively large.
When I add the measure as a filter on the table visual level (Measure <> 0), then Power BI can handle it in terms of memory.

One more question, what is the function of the +0 at the end of the measure?

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.