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.
I am trying to create a measure to use in my visuals that will filter all dates that cross a range.
So I have one table that has start date & end date columns. I also have a Date Table with unique dates in a range with a relationship. I pull in my Unique Date Slicer and I write a measure against the Data Table that looks similar to this.
FILTER (
'DataTable',
( 'DataTable.StartDate <= dateSlicer.minDate
&& DataTable.EndDate >= dateSlicer.maxDate )
)
And then put visual level filter with that measure thats greater than 0
This works but in my table I don't get the results I want unless i filter down to a single day.
so if I have a record with a start Date and end Date of 8/11 a single day it will not show up in my main table until I filter down to that one day.
Here is a Sample PBIX file - https://drive.google.com/open?id=1mBnO6FtAQ00iRmaFKbImLEV_DR_u72WW
Solved! Go to Solution.
Hey,
the problem that you have to tackle is called "events in progress", here you will find some readings that also provide solutions.
and a whitepaper that describes the problem in much detail
Regards,
Tom
your filter function is wrong. you were looking at < min date and more than max date. you needed to look at between the 2 dates
Count Rows =
VAR maxDate =
MAX ( 'Date'[Date] )
VAR minDate =
MIN ('Date'[Date])
RETURN
CALCULATE (
COUNTROWS ( Records ),
FILTER (
Records,
( Records[Start Date].[Date] >= minDate
&& Records[Fake End Date].[Date] <= maxDate )
)
)
Hey,
the problem that you have to tackle is called "events in progress", here you will find some readings that also provide solutions.
and a whitepaper that describes the problem in much detail
Regards,
Tom
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |