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 everyone,
My model has 2 filters on all pages: a QUARTER slicer and a YEAR slicer
I need to write a meansure (to use as a TITLE for several pages) to obtain the following results:
ACTION | RESULT OF THE MEASURE |
NO QUARTER selection - YEAR SELECTION = 2020 | REFERENCE PERIOD: 2020 |
ONE QUARTER selection (Q1) - YEAR = 2020 | REFERENCE PERIOD: 2020 - Q1 |
TWO QUARTER selections (Q1/Q2) - YEAR = 2020 | REFERENCE PERIOD: 2020 - Q1/Q2 |
THREE QUARTER selections (Q1/Q2/Q3) - YEAR = 2020 | REFERENCE PERIOD: 2020 - Q1/Q2/Q3 |
FOUR QUARTER selections (Q1/Q2/Q3/Q4) - YEAR = 2020 | REFERENCE PERIOD: 2020 |
I hope someone can help me
thanks for your attention
bye
Paolo
Solved! Go to Solution.
Hi @paolomint ,
You could use ISFILTERED() and ALLSELECTED() to get slicer status. Here is my result.
Here is my test file for your reference.
Hi @paolomint ,
You could use ISFILTERED() and ALLSELECTED() to get slicer status. Here is my result.
Here is my test file for your reference.
thank you very much, love your solution
I put it in my model, it works but I see a strange things, never seen before.
The result of the measure is 2020 when quarter are selected (eg 2020 - Q1/Q2) but is 2,020.00 when quarter are not selected.
As you can see on the picture, I can't change the data type (TESTO = TEXT) or the format.
What's happened in your opinion?
Thanks for your support
@paolomint , Are trying YTD ?
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...
Appreciate your Kudos.
@paolomint - See if this helps: https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Most-Amazing-Mind-Blowing-Dynamic-Slicer...
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 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |