Forum Discussion

SnGad's avatar
SnGad
New Member
7 years ago
Solved

Changing column format according to value

Hi, I have created unpivot column 'Value' of two columns - Amount and Count in power BI. Measurement    Value Amount             135 Amount             1000 Count                 1 . . . I w...
  • moumipanja's avatar
    7 years ago

    You can not have different datatype or format for a single column. However, if you want just the currency sign to be displayed for Measurement = "Amount", then you can try the following steps:

     

    1. Change the datatype of your Value column to Text

     

     

    2. Then create a new calculated column using the following DAX:

    Column2 = IF(Sheet2[Measurement]="Amount", ( FORMAT ( CURRENCY ( Sheet2[Value] ), "Currency" )), Sheet2[Value] )
     
    3. You can use other DAX queries as well to concatenate a $ symbol with Value when Measure = "Amount" 
    Column 3 = IF(Sheet2[Measurement]="Amount", CONCATENATE("$",Sheet2[Value]), Sheet2[Value])
     
     
    Let me know if this works for you.