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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lherbert501
Post Partisan
Post Partisan

Dynamic Title Field Parameter

Hi,

 

I have my measure below which it accepts the dax okay.

 

TESTDynamicTitle =
VAR a =
    CALCULATE ( DISTINCTCOUNT ( DimDate[Month] ), ALLSELECTED ( DimDate[Month] ) )
VAR b =
    CALCULATE ( DISTINCTCOUNT ( DimDate[Month] ), ALL ( DimDate[Month] ) )
return

  "" &
  CONCATENATEX (
        VALUES ( 'Parameter'[Parameter] ),
       'Parameter'[Parameter],
        " ,")
    & " Sales for " & IF( a = b, FIRSTNONBLANK(DimDate[YearNumCal],1), FIRSTNONBLANK(DimDate[Month],1 ))
 
 
But when I put it into the dynamic title I get the below error. 
I've looked into Using SELECTEDVALUE with Fields Parameters in Power BI - SQLBI which looks similar, but I cant seem to get it to like the dax. Is there an alternative method?
 
Thankyou
 
lherbert501_0-1677229413932.png

 

 
 
 
1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @lherbert501 

The easiest fix would be to change

 

CONCATENATEX (
    VALUES ( 'Parameter'[Parameter] ),
    ...

 

into

 

CONCATENATEX (
    'Parameter',
    ...

 

Since there should be no duplicates in the 'Parameter'[Parameter] column, the result should be as intended.

 

Passing a field parameter column reference to VALUES suffers from the same underlying problem as passing one to SELECTEDVALUE.

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

3 REPLIES 3
kaisrec
Advocate I
Advocate I

@lherbert501 , is it possible to apply the same logic to column header?
Use a Function in Field Parameters Header - Microsoft Fabric Community

OwenAuger
Super User
Super User

Hi @lherbert501 

The easiest fix would be to change

 

CONCATENATEX (
    VALUES ( 'Parameter'[Parameter] ),
    ...

 

into

 

CONCATENATEX (
    'Parameter',
    ...

 

Since there should be no duplicates in the 'Parameter'[Parameter] column, the result should be as intended.

 

Passing a field parameter column reference to VALUES suffers from the same underlying problem as passing one to SELECTEDVALUE.

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Thankyou @OwenAuger 

 

It seems so simple now I see it! 😀

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.