cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kkalyanrr Member
Member

Creating a dynamic chart(with formats Number and Percentage)

Hello,

 

I'm trying to creat a dynamic chart(Stacked Bar Chart)  which can display a metric in both number and percentage formats..

I tried creating a switch measure with appropriate formulae but the problem is it is showing both in same decimal format.

 

Please help me in Capture.JPGgetting the actual result.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-yulgu-msft
Microsoft

Re: Creating a dynamic chart(with formats Number and Percentage)

Hi @kkalyanrr,

 

It is not supported to make a measure to dynamically return different data types for result. As you can in below screenshot, using FORMAT function to format result converts the data type to Text which resulted in the blank chart.

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
itsmebvamsi Member
Member

Re: Creating a dynamic chart(with formats Number and Percentage)

@kkalyanrr try two things 

 

1) Check these properties

 

Visualizations -> Format tab- > Go to Field Formatting-> There is a parameter 'Value decimal places

 

OR

 

2) Create follwing measure or column using Format Fixed (replace with your columns)

 

Swith = SWITCH(TRUE(),Report[Column]=1,FORMAT([Measure],"Fixed"),Report[Column]=2,FORMAT([Measure2],"Fixed"))

 

kkalyanrr Member
Member

Re: Creating a dynamic chart(with formats Number and Percentage)

@itsmebvamsi

 

I've tried both the options but couldnt get the exact result..

 

The result I was looking for, when I use "Number" in slicer selection the chartr shld display number values(like 12,14) and "Percentage" in slicer selection the chart should display Percentage values(like 20%,30%)

 

Thanks..

itsmebvamsi Member
Member

Re: Creating a dynamic chart(with formats Number and Percentage)

@kkalyanrr I am able to switch measure and format it using following formula

 

Swith = SWITCH(TRUE(),Report[Column]="Number",FORMAT([Number],0),Report[Column]="Percentage",FORMAT([Percentage],"Percent")
kkalyanrr Member
Member

Re: Creating a dynamic chart(with formats Number and Percentage)

@itsmebvamsi

Its working fine for Card chart but not with the  Bar Charts..Please see the attached screenshot.


Capture1.JPG

itsmebvamsi Member
Member

Re: Creating a dynamic chart(with formats Number and Percentage)

@kkalyanrr Apparently I am also observing same issue, I had gone through few threads, they also facing same issue, seems to be limitations in PBI as far as my understanding.

Microsoft v-yulgu-msft
Microsoft

Re: Creating a dynamic chart(with formats Number and Percentage)

Hi @kkalyanrr,

 

It is not supported to make a measure to dynamically return different data types for result. As you can in below screenshot, using FORMAT function to format result converts the data type to Text which resulted in the blank chart.

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors