Forum Discussion

RajaSadagopan's avatar
RajaSadagopan
Regular Visitor
1 year ago
Solved

Custom Display unit for visualisation

Hi Y'all,

I want to display the bn as B for all the charts and visualisation, aswell as want to have the auto display feature where if the data is filtered, it automatically changes to M,K or B depending on the filter.

 

3 Replies

  • Hi RajaSadagopan  You can acheive this by using a custom label measure. For my case, I want to change dynamic label for measure Revenue. Try below code:

    DynamicLabel = 
    SWITCH(
        TRUE(),
        [Revenue] >= 1000000000, FORMAT([Revenue]/1000000000, "0.0") & "B",
        [Revenue] >= 1000000, FORMAT([Revenue]/1000000, "0.0") & "M",
        [Revenue] >= 1000, FORMAT([Revenue]/1000, "0.0") & "K",
        FORMAT([Revenue], "0")
    )

     

    Select the visual, turn on Data Label, go to value and replace default measure with the newly create custom dynamic label measure. See image below:

     

    Hope this helps!!

    If this solved your problem, please accept it as a solution!!

     

     

    Best Regards,
    Shahariar Hafiz

    • RajaSadagopan's avatar
      RajaSadagopan
      Regular Visitor

      Hi Thank you!! But the above solution is working only for Bar and column chart. What about Pie and donut??

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi RajaSadagopan ,

    I create a table as you mentioned.

    The only displays of numbers in the Donut chart are the following.

    Since Measure for Donut chart in PowerBI can only be placed in tooltips, you can create a Measure.

    FormattedAmount =
    VAR AmountInBillion =
        MAX ( 'Table'[Amount] ) / 1000000000
    RETURN
        FORMAT ( AmountInBillion, "0.0" ) & "B"

    If you want to use Dynamic Format Strings for Measures, you can check this official documentation below: Deep dive into the new Dynamic Format Strings for Measures! | Microsoft Power BI Blog | Microsoft Power BI

     

     

    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.