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.
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.
So with the above selected date range, only the rows marked here as '1' should appear in the table visual in Power BI:
The first 4 columns all come from a single table.
Solved! Go to Solution.
@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
@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
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?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |