Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Concatenate two measures

Hi Experts

 

Having trouble trying to concatenate two measure so the end result is Value (%).

The first Measure is the Value (£) part

VAR Mth1 =

SELECTEDVALUE ( SelMth[Month] )

VAR yr =

SELECTEDVALUE ( Year_Grp[Year] )

VAR Fcst1 =

SELECTEDVALUE ( SelMth4[Actual] )

VAR Acct =

SELECTEDVALUE ( Grp_Sumry_Rep[AccountGroup] )

 

 

VAR MthVal =

 

CALCULATE (

SUM ( Profitability_Consolidation[Profit]),

Profitability_Consolidation[Period] = Fcst1,Profitability_Consolidation[Year] = yr, Profitability_Consolidation[AccountGroup] = Acct,  Profitability_Consolidation[Product] = "Total"

)

RETURN

MthVal

 

The second measure is the (%) part

Percentage = DIVIDE(SUM(Profitability_Consolidation[Profit]),CALCULATE(SUM(Profitability_Consolidation[Profit]),ALLSELECTED(Profitability_Consolidation)))

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous 

     

    Before using CONCATENATE() function to join values you will need to format the measures to text type.

    And if you have more than two values need to be joined, you could use "&".

     

    Measure = CONCATENATE(FORMAT([Measure1],"##£ "),FORMAT([Measure2],"percent"))

     

    Result would be shown as below.

     

     

    Best Regards,

    Jay

2 Replies

  • Hi Anonymous ,

     

    In theory if you do something similar to this it will do the job:

     

    Concatenation = Format([First Measure], "### £") & FORMAT([Second Measure], "##%")

     

    You need to make both measure in the text format and the concatenate them that is the use of the FORMAT formula however depending on the context the result may not be has expected.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    Before using CONCATENATE() function to join values you will need to format the measures to text type.

    And if you have more than two values need to be joined, you could use "&".

     

    Measure = CONCATENATE(FORMAT([Measure1],"##£ "),FORMAT([Measure2],"percent"))

     

    Result would be shown as below.

     

     

    Best Regards,

    Jay