Forum Discussion

niculeica's avatar
niculeica
Helper I
2 years ago
Solved

Multiple Data formats in the same Metric

Hi! Having some issues when displaying a metric with multiple data formats (Percent & Currency: "€ #,##0"). The format formula I'm using is below (Format is set to Dynamic beforehand).

 

IF(MAX(_RevenueSources[Revenue Type])="Target Attainment Rec. Rev. (Month)"||MAX(_RevenueSources[Revenue Type])="Target Attainment Rec. Rev. (YTD)",
FORMAT([_Revenue Amount raw2],"Percent"),
FORMAT([_Revenue Amount raw2],"€ #,##0"))
 
Basically, when Revenue Type is a form of Attainment, I want it to show me Percentages, else custom currency format "€ #,##0". However, for Revenue Type different than Attainment, numbers are getting messed up. I'm attaching what is currently showing (in this order) and what the numbers should be. Any idea what might be the problem?
 

 

 

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi niculeica ,

    I create a table as you mentioned.

    Then I create two calculated columns. Here are the DAX codes.

    Column = FORMAT('Table'[Number],"0.00%")
    Column 2 = FORMAT('Table'[Score],"€ #,##0")

    Then I put it into the matrix table. It will give you what you want.

     

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi niculeica ,

    I create a table as you mentioned.

    Then I create two calculated columns. Here are the DAX codes.

    Column = FORMAT('Table'[Number],"0.00%")
    Column 2 = FORMAT('Table'[Score],"€ #,##0")

    Then I put it into the matrix table. It will give you what you want.

     

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.