Forum Discussion

lherbert501's avatar
lherbert501
Post Prodigy
3 years ago
Solved

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
 

 

 
 
 
  • 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

3 Replies