Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I have created a field parameter :
I want to get a dynamic title for the visualization in which i am using this parameter with the condition that if user select more then 3 metric it the title should show etc ie those three metric and etc.I tried some approaches but getting error:
select metri 3 [select mertic 3] is part of composite key but not all columns of composite key is included in expression.Your help will be appriciated.
Solved! Go to Solution.
Hi @Deepanshu_46
You can use DAX measure :
Link for more information :
https://www.sqlbi.com/blog/marco/2022/06/11/using-selectedvalue-with-fields-parameters-in-power-bi/
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi @Deepanshu_46 ,
Here are the steps you can follow:
1. Create calculated column.
Rank_column = RANKX('Table 2','Table 2'[Value1],,ASC)
2. Create measure.
Rank_measure =
RANKX(ALLSELECTED('Table 2'),CALCULATE(SUM('Table 2'[Rank_column])),,ASC)
Measure =
var _count=COUNTX(ALLSELECTED('Table 2'),'Table 2'[Value1])
var _Select=SELECTCOLUMNS('Table 2',"tag",'Table 2'[Value1])
var _title1=
CONCATENATEX(
FILTER(ALL('Table 2'),
'Table 2'[Value1] in _Select),'Table 2'[Value1],"丶")
var _rank=
RANKX(
FILTER(
ALLSELECTED('Table 2'),'Table 2'[Value1] in _Select),CALCULATE(MAX('Table 2'[Value1])),,ASC)
var _title2=
CONCATENATEX(
FILTER(ALLSELECTED('Table 2'),
[Rank_measure]<=3),'Table 2'[Value1],"丶")
return
IF(
_count>3,
_title2&" "&"etc.",_title1)
3. Visual -- Format – TiTLE -- FX
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Deepanshu_46 ,
Here are the steps you can follow:
1. Create calculated column.
Rank_column = RANKX('Table 2','Table 2'[Value1],,ASC)
2. Create measure.
Rank_measure =
RANKX(ALLSELECTED('Table 2'),CALCULATE(SUM('Table 2'[Rank_column])),,ASC)
Measure =
var _count=COUNTX(ALLSELECTED('Table 2'),'Table 2'[Value1])
var _Select=SELECTCOLUMNS('Table 2',"tag",'Table 2'[Value1])
var _title1=
CONCATENATEX(
FILTER(ALL('Table 2'),
'Table 2'[Value1] in _Select),'Table 2'[Value1],"丶")
var _rank=
RANKX(
FILTER(
ALLSELECTED('Table 2'),'Table 2'[Value1] in _Select),CALCULATE(MAX('Table 2'[Value1])),,ASC)
var _title2=
CONCATENATEX(
FILTER(ALLSELECTED('Table 2'),
[Rank_measure]<=3),'Table 2'[Value1],"丶")
return
IF(
_count>3,
_title2&" "&"etc.",_title1)
3. Visual -- Format – TiTLE -- FX
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
It works. Thankyou so much for your kind help.
Hi @Ritaf1983 , thanks for your reply. I have many categories and I want I user select more then three category from the slicer , the title should show only three category name in the title along with etc for example if user select visit, bounce, spend and clicks, title should showe visit, bounce, spend etc.I hope it gives you more clarity on of my requirement.
Hi @Deepanshu_46
You can use DAX measure :
Link for more information :
https://www.sqlbi.com/blog/marco/2022/06/11/using-selectedvalue-with-fields-parameters-in-power-bi/
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
68 | |
57 | |
55 | |
36 | |
34 |
User | Count |
---|---|
76 | |
73 | |
48 | |
45 | |
43 |