Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Dynamic Titles for Month over Month, Quarter over Quarter, Year over Year

Hi,

 

I am a new user to powerbi and I have been tasked to do a sales report. The report consists of time series comparisions such as month over month , quarter over quarter and year over year. My issue currently is that I have no clue how to make a dynamic title that changes based on the filter selection by the user. (the user is using the filter pane). 

 

For example,

 

If the user chooses a year and only a year as a filter, the title should show YOY (or Year over year ). If he or she selects a quarter in addition to the year the title should show QOQ (or quarter over quarter). This applies for month selection as well. 

 

I have had a look at the 'SWITCH' dax function, but I do not have any sustainable values to attribute to the expression. Just to sign post : SWITCH (expression,value1, result 1...[else]). I am really lost on how to resolve this problem as the user currently will have no idea if what they selected in the filters are yoy, qoq, or mom comparisions without a title. 

 

Thank you for your help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

Thank you so much for the reply it has taught me how to use the switch function in this situation. However, this dax formula works only when quarter or month is selected independantly from year. 

 

For example, when I click on a month option in the filter pane after filtering year to 2019, the card still shows "YOY" when it should show "MOM". But when I click the month option only in the filter pane without specifying the year, it changes to "MOM" , my data is no longer useful. Because if I selected "January" without specifying which year, the data gives me the sum of "Jan 2019+ Jan 2018 +Jan 2017" as a result when what I need is "Jan 2019" only. 

 

Thank you so much for your help once again!

 

Cheers,

Alex

View solution in original post

2 REPLIES 2
dax
Community Support
Community Support

Hi AlexOudea, 

It seems that you will use page filter to choose  Year or Month, right? If so, you could use a  card  as title and use below measure

Measure = switch(TRUE(),ISFILTERED('Table 2'[year]), "YOY", ISFILTERED('Table 2'[month]), "MOM")

496.PNG

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hi,

 

Thank you so much for the reply it has taught me how to use the switch function in this situation. However, this dax formula works only when quarter or month is selected independantly from year. 

 

For example, when I click on a month option in the filter pane after filtering year to 2019, the card still shows "YOY" when it should show "MOM". But when I click the month option only in the filter pane without specifying the year, it changes to "MOM" , my data is no longer useful. Because if I selected "January" without specifying which year, the data gives me the sum of "Jan 2019+ Jan 2018 +Jan 2017" as a result when what I need is "Jan 2019" only. 

 

Thank you so much for your help once again!

 

Cheers,

Alex

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors