cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
paolomint
Helper II
Helper II

Dynamic title from multiple selections of the same slicer

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:

 

ACTIONRESULT OF THE MEASURE
NO QUARTER selection  - YEAR SELECTION = 2020REFERENCE PERIOD: 2020 
ONE QUARTER selection (Q1) - YEAR = 2020REFERENCE PERIOD: 2020 - Q1
TWO QUARTER selections (Q1/Q2) - YEAR = 2020 REFERENCE PERIOD: 2020 - Q1/Q2
THREE QUARTER selections (Q1/Q2/Q3) - YEAR = 2020REFERENCE PERIOD: 2020 - Q1/Q2/Q3
FOUR QUARTER selections (Q1/Q2/Q3/Q4) - YEAR = 2020REFERENCE PERIOD: 2020 

  

I hope someone can help me

thanks for your attention

bye

Paolo 

 

 

 

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @paolomint ,

 

You could use ISFILTERED() and ALLSELECTED() to get slicer status. Here is my result.

1-1.PNG

Here is my test file for your reference.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @paolomint ,

 

You could use ISFILTERED() and ALLSELECTED() to get slicer status. Here is my result.

1-1.PNG

Here is my test file for your reference.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Hi @v-eachen-msft 

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

20200804_155512.jpg

 

amitchandak
Super User IV
Super User IV

@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.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Greg_Deckler
Super User IV
Super User IV

@paolomint - See if this helps: https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Most-Amazing-Mind-Blowing-Dynamic-Slicer...


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors