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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Conditional formatting on data type in chart

Hello everybody!

 

In my report I have a line chart which shows values that are dependent on which category you choose in a filter. However the values are always shown in one format, based on the data type. Is there a way to format some values (dependent on which category you choose) as a time and others as decimal?

 

Data example:

 

IDEmployeeDateMetricValue
1John01/01/2020SALES_VALUE1200
2Peter01/01/2020WORK_TIME01:37:00
3Peter01/01/2020SALES_PERCENT25%


I expect to get a line graph, where the manager could choose one metric, and this metric would appear with the correct format.

 

Is there any way to do this without splitting into different columns and formatting each?

 

Thanks!

8 REPLIES 8
amitchandak
Super User
Super User

@Anonymous , When you change measures inside a measure then formatting is an issue. Unless you pre-format them. Bookmark can replace chart and allow you to do

 

For slicer way refer: https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115

for bookmark refer : https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive

 

Please Watch/Like/Share My webinar on Time Intelligence: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
My Youtube Tips at: https://www.youtube.com/playlist?list=PLPaNVDMhUXGYrm5rm6ME6rjzKGSvT9Jmy

Appreciate your Kudos.

Greg_Deckler
Super User
Super User

If returning text is OK then you can use FORMAT.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hello! 

@Greg_Deckler 

Well, I guess not, because the graph will also feature a daily average per metric. Is there some way to do math operations if returns text? 

Hard to say without more information @Anonymous . But you can do the math and just return the correct format at the end. Should work for totals as well. So within the measure you could check for the total row/column using something like HASONEVALUE and if it is a total row, do an AVERAGEX and then FORMAT.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler  Hello!

 

I've created a exemple project, can you take a look? There is a line graph with metric x time, and I filter it by metric.

 

https://drive.google.com/file/d/1IZRugbtavASNUdR-12XVrQjRix0sYJ2b/view?usp=sharing

 

 

Hi @Anonymous ,

 

It can't be achieved in one table to dynamic change data type based on slicer in one chart . You can refer to the  similar post : https://community.powerbi.com/t5/Desktop/Need-to-change-symbol-format-based-on-slicer-selection/td-p/1030056

 

As a workaround, you should divided them into three tables and use bookmark to achieve your requirement.

 

Best Regards,

Dedmon Dai

Anonymous
Not applicable

Hi @v-deddai1-msft could you elaborate on that? Would I need to create 3 separated visuals?

Hi @Anonymous ,

 

Yes, you need to create three visuals for it. Please refer to the simliar post: https://community.powerbi.com/t5/Desktop/Dynamic-grouping-based-on-slider-selections/td-p/1003423

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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