Forum Discussion

hugo_barbara's avatar
hugo_barbara
Helper I
1 year ago
Solved

One column, multiple data types

Guys, good afternoon. Would you know a way to format several types of data that are in a single column? For example, I have a column to insert into a bar chart with the following types: monetary ($...
  • dharmendars007's avatar
    1 year ago

    Hello hugo_barbara , 

    You can create a calculated column in DAX that formats the values as text based on their type try this for table visual.

     

    Formatted Values =
    SWITCH(
    TRUE(),
    'YourTable'[Type] = "Monetary", FORMAT('YourTable'[Value], "$#,##0.00"),
    'YourTable'[Type] = "Percentage", FORMAT('YourTable'[Value], "0.00%"),
    'YourTable'[Type] = "Integer", FORMAT('YourTable'[Value], "#,##0"),
    BLANK())

    If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

     

    Thank You

    Dharmendar S

    LinkedIN