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.
My report consists of a line chart that is controlled by a date slicer (you pick the start and end date) and a few measures.
I have no issues with the line chart, but I would like to use the date slicer as a filter in the measure calculations. One measure could be called yearly incidents, where I use COUNTROWS() and some filters to calculate the incidents over a specific time period.
I would like to display the yearly number of incidents and this year would be controlled by the date slicer. For example, picking a end date of 30.5.2019 would select 2019 to be used as the filter and the measure calculation would include all events from this year (until today). Even if we picked a start date of 1.5.2019, the measure still needs to display all incidents from this year. So, the date slicer can't be linked to the measure card in interactions.
I tried to extract the year by using
What would be the best way to implement this? I'm using DirectQuery if that impacts something (I could always switch over to Import if needed).
Solved! Go to Solution.
Hi,
In the filter portion of the CALCULATE() function, try this
DATESBETWEEN('Date'[Date],DATE(YEAR(MIN('Date'[Date])),1,1),TODAY())
Does this work?
Hi @PowerBI101 ,
Have you solved your problem?
If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If you still need help, please share your data sample and your desired output.
Best Regards,
Cherry
Hi,
In the filter portion of the CALCULATE() function, try this
DATESBETWEEN('Date'[Date],DATE(YEAR(MIN('Date'[Date])),1,1),TODAY())
Does this work?
Hi @PowerBI101 ,
To understand your scenario better, could you share some data sample which could reproduce the scenario and your desired output so that we could help further on it?
Best Regards,
Cherry
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 |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
107 | |
105 | |
87 | |
61 |