Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
augustindelaf
Impactful Individual
Impactful Individual

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 4
kaushikd
Resolver II
Resolver II

 

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.

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

@augustindelaf solution you listed will work. do you need help on how to put this together?

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k,

 

 

We finally decided not to do things like that, but in another way.

this would have been a pleasure to have your help.

 

thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.