Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi i need help to make conditional formatting but each row depends on different value.
at 'On Hand qty', the background color depends on the 'Target quantity' such as:
on the fifth row, 'target quantity' is 3,
so if 'on hand qty' >= 3 is green, and 3 < is red
but,
on the seventh row, 'target quantity' is 13,
so if 'on hand qty' >= 13 is green, and 13 < is red
Solved! Go to Solution.
@muhaiza Please update your code as below:-
measure 3=
IF (
SUM ( INF[On Hand Qty] ) >= INT ( MAX ( INF[Target Quantity] ) ),
"Green",
"Red"
)
Output:-
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @muhaiza ,
If on hand qty and target quantity are measure then try this:-
measure 3 = if( [OnHand Qunatity] >= [target quantity] , "Green","Red")
or if those are column then use below code:-
measure 3 = if( sum(table[OnHand Qunatity]) >= sum(table[target quantity]) , "Green","Red")
Now add this measure like below for conditional formatting:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Samarth_18 ,
why it says the value cannot be determined? i'am very sure the spelling of my column is all true
Please try this:-
measure 3 = if( sum(table[OnHand Qunatity]) >= sum(table[target quantity]) , "Green","Red")
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
okay, now the coding seems working, but why i can't click on the measure 3?😢
Hi @Samarth_18 ,
this is the link. Thank you!
https://drive.google.com/file/d/1PxUzDk9NABnJJukSb1DBb0UwRXOz-2Bg/view?usp=sharing
@muhaiza Please update your code as below:-
measure 3=
IF (
SUM ( INF[On Hand Qty] ) >= INT ( MAX ( INF[Target Quantity] ) ),
"Green",
"Red"
)
Output:-
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
@muhaiza , Create a new color measure
Switch( True() ,
[target quantity] = 3 && [OnHand Qunatity] >=3 , "Green",
[target quantity] = 3 && [OnHand Qunatity] < 3 , "Red",
[target quantity] = 13 && [OnHand Qunatity] >=13 , "Green",
[target quantity] = 13 && [OnHand Qunatity] <13 , "Red"
)
Change the value as per need. Use in conditional formatting using field value option
How to do conditional formatting by measure and apply it on pie? : https://youtu.be/RqBb5eBf_I4
Hi @amitchandak , Thank you!
Sorry, i'm still new to this but why it says 'cannot find name'?
do i need to declare something first?
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
93 | |
85 | |
83 | |
72 | |
49 |
User | Count |
---|---|
142 | |
139 | |
110 | |
69 | |
55 |