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
sarath_chandra
Helper III
Helper III

Conditional formatting help

sarath_chandra_0-1673359470336.png

Hi all,

actually ,above is my matrix visual in my power bi(PN is part number ,and values are usage of part number in every week of (2018,2019,2020,2021....)

i need some help in conditional formatting

1.dynamically it should show the latest week(9/2/2018) - Top 15 usage values.

2.There is lot of empty values are there in matrix values - need to bring zeros in empty places

3.dynamically,every week compare the previous week usage values (i) If the value is higher than previous week value - it should show some different font color or different back ground colour/symbol (ii) If the value is equal to previous week value - it should show some different font color or different back ground colour/symbol (iii)  If the value is less than previous week value - it should show some different font color or different back ground colour/symbol

4.If the usage of PN for continous three weeks - it should show all three values in different color/symbol

 

can you all please help me in this ? 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @sarath_chandra 

 

You can try the following methods.

Measure:

Current value = SUM('Table'[usage value])+0
Previous value = CALCULATE([Current value],FILTER(ALL('Table'),[Weeknum]=SELECTEDVALUE('Table'[Weeknum])-1&&[PN]=SELECTEDVALUE('Table'[PN])))
Diff = [Current value]-[Previous value]
Color = IF([Diff]=0,"Yellow",IF([Diff]>0,"Green","Red"))

vzhangti_1-1673509599287.png

vzhangti_0-1673509582112.png

Is this the result you expect? The last question is what kind of output you expect it to be, and can you show it in pictures.

 

Best Regards,

Community Support Team _Charlotte

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

7 REPLIES 7
v-zhangti
Community Support
Community Support

Hi, @sarath_chandra 

 

You can try the following methods.

Measure:

Current value = SUM('Table'[usage value])+0
Previous value = CALCULATE([Current value],FILTER(ALL('Table'),[Weeknum]=SELECTEDVALUE('Table'[Weeknum])-1&&[PN]=SELECTEDVALUE('Table'[PN])))
Diff = [Current value]-[Previous value]
Color = IF([Diff]=0,"Yellow",IF([Diff]>0,"Green","Red"))

vzhangti_1-1673509599287.png

vzhangti_0-1673509582112.png

Is this the result you expect? The last question is what kind of output you expect it to be, and can you show it in pictures.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sarath_chandra
Helper III
Helper III

sarath_chandra_0-1673362157401.png

every week i will get the data with date ,part numbers and usage values like this format @BeaBF .

please help me out 🙏

BeaBF
Impactful Individual
Impactful Individual

@sarath_chandra Hi! Can you attack a pbix file with the same sample data above in order to provide you the expected results?

 

BBF

Thank you so much for your quick response. Im not able to attach the pbix file in this power bi community . options are not available for me .sorry for inconvience.

above image is in  matrix visual of power bi .

date is in columns 

PN is in rows

values is in value 

@sarath_chandra OK, can you paste some sample data in the reply?

 

BBF

DatePNusage value
05/01/20187ui452
12/01/20188u89118
23/01/20188u89162
02/02/201845677
09/02/2018456710
02/02/20188u8982
09/02/20188u89106
23/01/20187ui456
02/02/201878694
09/02/201878694
05/01/2018879013
12/01/2018879031
23/01/2018879073
02/02/2018879018

@sarath_chandra ok, let's start from point 2, the blank values.

You have to create a table starting from the native, making a distinct on the Date field, then create a relationship between the two tables and use the Date field of the new table in the matrix. At this point in "values" put a new measure that makes the sum of the usage field +0.

I am attaching a pbix with this point done with example data. Let me know if you have any questions, in the meantime I'll sort out the remaining points.

 

BBF

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.