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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Community Champion
Community Champion

If returning text is OK then you can use FORMAT.



Follow on LinkedIn
@ 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!:
DAX For Humans

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.


Follow on LinkedIn
@ 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!:
DAX For Humans

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.