Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Formatting Of Values

Hi

 

I am looking for a tip regarding the below visual.

 

1. Does anyone know which visual it is (screen "Goal")? It doesn't seem to be a standard matrix.

2. How can I format various metrics in a different way (dollars, whole number, percentage) based on my dataset? Please note that I can pivot/unpivot columns - that is not a problem.

 

My ultimate goal is that I have various metrics in column "Metric" and some of them should be shown as a percentage, some other ones as value or as a dollar.

 

thank you

 

Goal:

 

My Matrix:

 

My dataset:

 

Business UnitAccount Desc.MetricPeriodScenarioValue
YHZAGMAcqDivAcquire/DivestSaturday, February 1, 2020Actual14
YYYAGMAcqDivAcquire/DivestSaturday, February 1, 2020Actual14
ZZZAGMAcqDivAcquire/DivestSaturday, February 1, 2020Actual14
YHZAGMAcqDivAcquire/DivestWednesday, January 1, 2020Actual13
YYYAGMAcqDivAcquire/DivestWednesday, January 1, 2020Actual13
ZZZAGMAcqDivAcquire/DivestWednesday, January 1, 2020Actual13
YHZAGMAcqDivAcquire/DivestSunday, March 1, 2020Actual13
YYYAGMAcqDivAcquire/DivestSunday, March 1, 2020Actual13
ZZZAGMAcqDivAcquire/DivestSunday, March 1, 2020Actual13
YHZAGMAcqDivAcquire/DivestWednesday, April 1, 2020Actual13
YYYAGMAcqDivAcquire/DivestWednesday, April 1, 2020Actual13
ZZZAGMAcqDivAcquire/DivestWednesday, April 1, 2020Actual13
YHZAGMAcqDivAcquire/DivestFriday, May 1, 2020Actual13
YYYAGMAcqDivAcquire/DivestFriday, May 1, 2020Actual13
ZZZAGMAcqDivAcquire/DivestFriday, May 1, 2020Actual13
ABCDTradeAGMAGMWednesday, January 1, 2020Actual4345
ABCDTradeAGMAGMSaturday, February 1, 2020Actual4840
ABCDTradeAGMAGMSunday, March 1, 2020Actual4565
ABCDTradeAGMAGMWednesday, April 1, 2020Actual5418
ABCDTradeAGMAGMFriday, May 1, 2020Actual4340
EFGTradeAGMAGMWednesday, January 1, 2020Actual1643
EFGTradeAGMAGMSaturday, February 1, 2020Actual1892
EFGTradeAGMAGMSunday, March 1, 2020Actual1787
  • Hi Anonymous ,

    The visual in your "Goal" image looks like the standard matrix. 

    A single measure can only have a single data format. What you're seeing in that image is text formatting using the FORMAT() dax formula. 

    Take a quick look at this link:
    https://docs.microsoft.com/sv-se/dax/pre-defined-numeric-formats-for-the-format-function 

    Essentially this relies on the fact that you have numeric values of different types calculated and then you use a SWITCH() together with several different FORMAT()s to define how you want your numbers to be displayed. 

    Hope this helps,

    J

  • Hi Anonymous ,

     

    In addition, we can create a measure to replace your value to meet your requirement.

     

    Measure Value = 
    FORMAT(
        SUM('Table'[Value]),
        SWITCH (
            TRUE (),
            MAX('Table'[Metric])="AGM%", "Percent",
            MAX('Table'[Metric])="AGM","Currency",
            MAX('Table'[Metric])="Acquire/Divest","General Number"
        )
    )

     

     

    You can also refer to the post I answered earlier.

     

    https://community.powerbi.com/t5/Desktop/How-to-create-a-visual-like-this/td-p/1084043

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

    BTW, pbix as attached.

     

    Best regards,

     

    Community Support Team _ zhenbw

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

2 Replies

  • v-zhenbw-msft's avatar
    v-zhenbw-msft
    Community Support

    Hi Anonymous ,

     

    In addition, we can create a measure to replace your value to meet your requirement.

     

    Measure Value = 
    FORMAT(
        SUM('Table'[Value]),
        SWITCH (
            TRUE (),
            MAX('Table'[Metric])="AGM%", "Percent",
            MAX('Table'[Metric])="AGM","Currency",
            MAX('Table'[Metric])="Acquire/Divest","General Number"
        )
    )

     

     

    You can also refer to the post I answered earlier.

     

    https://community.powerbi.com/t5/Desktop/How-to-create-a-visual-like-this/td-p/1084043

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

    BTW, pbix as attached.

     

    Best regards,

     

    Community Support Team _ zhenbw

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

  • tex628's avatar
    tex628
    Community Champion

    Hi Anonymous ,

    The visual in your "Goal" image looks like the standard matrix. 

    A single measure can only have a single data format. What you're seeing in that image is text formatting using the FORMAT() dax formula. 

    Take a quick look at this link:
    https://docs.microsoft.com/sv-se/dax/pre-defined-numeric-formats-for-the-format-function 

    Essentially this relies on the fact that you have numeric values of different types calculated and then you use a SWITCH() together with several different FORMAT()s to define how you want your numbers to be displayed. 

    Hope this helps,

    J