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
Hello All,
I have data of suppliers with their regular prices and MSRP. I have created a measure that calculates % difference on regular prices with MSRP as a base value.
Now I want to highlight the row with the highest % difference. Please help me on how can calculate the same.
My data looks like below.
Solved! Go to Solution.
Hi @AbbasG ,
I modified my color measure. Please take a look.
Color =
VAR _rank =
RANKX (
FILTER (
ALLSELECTED ( 'All suppliers Combined Data' ),
[Model#] = MAX ( 'All suppliers Combined Data'[Model#] )
),
[Min of MSRP % difference from Min of Price],
,
DESC,
DENSE
)
RETURN
IF ( _rank = 1, "Green", "White" )
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@AbbasG ,
Highest Diff percent
overall = calculate(maxx(summarize(allselected(Table) , Table[Supplier], Table[Model], " _1", [Diff]) , [_1] ) )
Max By supplier = calculate(maxx(summarize(Table , Table[Supplier], " _1", [Diff]) , [_1] ), removefilters(Table[Model] ))
Max By supplier = calculate(maxx(summarize(Table , Table[Model], " _1", [Diff]) , [_1] ), removefilters(Table[Supplier] ))
Use one of them as per need to compare and create color measure
Color = Switch( True() ,
[Diff %] = [Overall] , "Green" ,"White")
And use that in coditional formatting using field value option
How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4
Hello @amitchandak
Thank you for the quick response. I have created the below measures. But it highlights all the value, can you please guide me what goes wrong?
Max By supplier = calculate(maxx(summarize(Table , Table[Supplier], " _1", [Diff]) , [_1] ), removefilters(Table[Model] ))
Color = Switch( True() ,
[Diff %] = [Overall] , "Green" ,"White")
@AbbasG , I think I should not have removed model from summarize
Max By supplier = calculate(maxx(summarize(Table , Table[Supplier],Table[Model] " _1", [Diff]) , [_1] ), removefilters(Table[Model] ))
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
@amitchandak Hi Amit, please find the .pbix file here
https://drive.google.com/file/d/1CJ_UgyjlBhytJ3q99mEsvCVmPZvy-uAB/view?usp=sharing
Hi @AbbasG ,
Is this the desired result you want?
Color measure is as follows.
Color =
VAR _rank =
RANKX (
FILTER (
ALLSELECTED ( 'All suppliers Combined Data' ),
[Supplier] = MAX ( 'All suppliers Combined Data'[Supplier] )
),
[Min of MSRP % difference from Min of Price],
,
DESC,
DENSE
)
RETURN
IF ( _rank = 1, "Green", "White" )
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-stephen-msft thank you for your response.
I want to highlight only the max % diff in each row.
Hi @AbbasG ,
I modified my color measure. Please take a look.
Color =
VAR _rank =
RANKX (
FILTER (
ALLSELECTED ( 'All suppliers Combined Data' ),
[Model#] = MAX ( 'All suppliers Combined Data'[Model#] )
),
[Min of MSRP % difference from Min of Price],
,
DESC,
DENSE
)
RETURN
IF ( _rank = 1, "Green", "White" )
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
87 | |
87 | |
83 | |
65 | |
49 |
User | Count |
---|---|
127 | |
108 | |
89 | |
70 | |
66 |