cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
v-yulgu-msft Super Contributor
Super Contributor

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.

v-yulgu-msft Super Contributor
Super Contributor

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
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 367 members 3,496 guests
Please welcome our newest community members: