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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
lherbert501
Post Patron
Post Patron

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.