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.
Hello guys,
Here is the problem I am facing.
I have a table with dates and multiple transactions per day.
I need to create a report where the user can select a specific date and a period (either MTD ither YTD).
Based on these two parameters, I should filter all the dates included in this time period.
For instance, if the user selects 15/04/2020 and MTD, it should filter and keep all the values between 01/04/2020 and 15/04/2020 in all the visuals of the report.
How can I do this filter based on these user-selected parameters ?
Thanks a lot for your help ! I hope the definition of the problem is clear.
Cheers,
Jay
Solved! Go to Solution.
Hi @Anonymous ,
Please refer to my .pbix file.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-lionel-msft The MTD is now working, I had to adapt it but it works.
What I need to correct now is that the YTD is actually based on the fiscal year, starting 1st of April and not 1st of Jan. How can I do that ?
@v-lionel-msft Can you explain me the logic behind the calculation of _min_date_by_year ?
I don't get it at atll.
Thanks a lot for your help !!
Hi @jejenial,
Condition 1:
I assume that your financial year starts in April, such as (4/1/2019~3/1/2020), (4/1/2020~3/1/2021), (4/1/2021~3/1/2022)... So I marked all the dates in April.
Condition 2:
Condition 2 is to ensure that the date obtained is the date of the current financial year.
In addition, MAX() here is equivalent to EARLIER().
Can the solution solve your problem?
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Has your problem been solved?
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-lionel-msft,
Thanks for your answer which helps already a lot.
The YTD works perfectly but the MTD does not and I don't know why.
Also, could you explain me the reason behind that line of code :
FILTER( ALL('calendar'), 'calendar'[Date].[Year] = MAX('calendar'[Date].[Year]) )
Why do you use MAX ?
Thanks,
Jerome
@Anonymous , refer if this can help
Additional
Power BI — YTD Questions — Time Intelligence 1–5
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
Power BI — QTD Questions — Time Intelligence 2–5
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
Power BI — MTD Questions — Time Intelligence 3–5
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |