Forum Discussion

augustindelaf's avatar
augustindelaf
Impactful Individual
9 years ago

Display data from the same column with different format

Hi, 

 

My question seems very simple but I can't do it !

 

in my data model I have a column that contains decimal numbers, but according to the value of another column ("euro", "percent"), I want my data to be displayed as Euros, or Percents, or Integers on a visual that is a Table, or a Matrix.

 

I think I have to create a Measure or Parameter for data format, right?

Please, if it is possible, don't tell me to create another column, because on my visual the same column has to be here, and data must have a different format, ie, it must display as euros if I select "Euro" on a slicer, or percents if I click Percents, or Integers if I choose "Integers."

 

Many thanks !

4 Replies

  •  

    Create two coulmn and apply the transformation to get the desired datatype asd rename the column as

    Euro Column

    Percent Column

     

    Now create a new table

    SelectionTable

    Position       Unit

    1                  Euro

    2                  Percent

     

     

    Now Create two measure

    1. SelectedSortMeasurePosition = MIN('Selection'[Position])

    2. SelectedSortMeasure = SWITCH(Selection[SelectedSortMeasurePosition],1,'Table'[Euro Column],2,'Table'[Percent Column],BLANK(),'Table'[Euro Column])

     

     

    Drop a slicer and in field choose 'SelectionTable'[Unit]

    In Chart Drop SelectedSortMeasure as field

     

    Now according to the selected slicer the type will change

     

     

    If this is what you required then please like and accept this as solution.

    • augustindelaf's avatar
      augustindelaf
      Impactful Individual

      Hello kaushikd,

       

      many thanks for your help.

       

      your method works fine until the 2nd measure that did not work.

      I guess it was : "SelectedSortMeasure = SWITCH(Selection[SelectedSortMeasurePosition],1,'Table'SUM[Euro Column],2,'Table'SUM[Percent Column],BLANK(),'Table'SUM[Euro Column]) ?

       

      anyway, the problem is that, in the end, I only have the data field "SelectedSortMeasure", and I have to give a data label to it. And the data label can only be of one type. Right?

       

      A colleague proposed me another option : like you i split the data in the beginning, and then I convert it to text format, and then I create conditional columns to concanete the text values with "EUR" or "%" if the values of the other columns are "Euro" or "Percent"

       

      Do you think it can work easily? (I am dealing with another pb right now... :(   )

      many thanks to you anyway