combined values title

djemy1975

Board Regular
Joined
Jan 18, 2016
Messages
51
Dear colleagues ,

I am going to create a dynamic title for my chart in power BI ,and I want to concatenate two slicers in this title
1- department slicer
2- month slicer

I want to display title as "Expenses by "Month" & "Department, when slicers are selected

I have the following measures:

Power Query:
Selected Month = VAR GetValues=CONCATENATEX(
VALUES('Date'[Month]); 'Date'[Month]; " & ")
RETURN
"Expenses by " & GetValues & " "

and
Power Query:
Selected Dept. = VAR GetValues=CONCATENATEX(
VALUES('mapping'[Département]); 'mapping'[Département]; " & ")
RETURN
" " & GetValues & " "

and title measure which combines both:
Power Query:
Title = COMBINEVALUES(" " ; [Selected Month] ;"for"; [Selected Dept.])

I have a small problem that when nothing is selected the title becomes so long ,whereas I want to display "no selection is made" or "all months for all departments" instead.


I think it has to do with "if isfiltered" function.

Screenshot 2021-04-18 114216.png



Best regards,
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Yes, please try

Power Query:
Selected Month
=VAR GetValues
    =if(ISFILTERED( 'date'[Month])
        ,CONCATENATEX(VALUES('Date'[Month]), 'Date'[Month], " & ")
        ,"no selection is made"
    )
RETURN "Expenses by " & GetValues & " "
 
Upvote 0
Yes, please try

Power Query:
Selected Month
=VAR GetValues
    =if(ISFILTERED( 'date'[Month])
        ,CONCATENATEX(VALUES('Date'[Month]), 'Date'[Month], " & ")
        ,"no selection is made"
    )
RETURN "Expenses by " & GetValues & " "
Thank you for your reply .I have used this function with slight modification replacing "no selection is made" with "All months".It works for months but still the problem with departments though I have made
the same as selected month function
.
Screenshot 2021-04-18 130015.png

Is there any workaround to solve this issue?
Regards,
 
Upvote 0
The logic is the same

Power Query:
Selected Dept.
=VAR GetValues
    =if(ISFILTERED( 'mapping'[Département])
        ,CONCATENATEX(VALUES('mapping'[Département]), 'mapping'[Département], " & ")
        ,"All Departement"
    )
RETURN " " & GetValues & " "
 
Upvote 0
The logic is the same

Power Query:
Selected Dept.
=VAR GetValues
    =if(ISFILTERED( 'mapping'[Département])
        ,CONCATENATEX(VALUES('mapping'[Département]), 'mapping'[Département], " & ")
        ,"All Departement"
    )
RETURN " " & GetValues & " "
 
Upvote 0

Forum statistics

Threads
1,223,718
Messages
6,174,077
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top