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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Mseeram
Frequent Visitor

Calculate min based on the selected values

Hello everyone,
I am trying to get the minimum amount based on selecting few subvendors

Mseeram_0-1647289363251.png
which I could able to achive it, now I need to create an other table comparing each subvendor with the above target column and get the cost difference and the percentage difference, somthing like below.

Mseeram_2-1647289868752.png

 

This should be dynamic, what ever selection I do in the first visual I have to compare the target min value with all the subvendors used in it can some one help me resolve this. I am attaching a sample Pbix and excel that I exported to create the 2nd visual.
https://cscishell-my.sharepoint.com/:u:/g/personal/mseeram_csci_build/EXPvLO5ZX9pOobDcg3d940QBOWo6Qa...

https://cscishell-my.sharepoint.com/:x:/g/personal/mseeram_csci_build/ER9F5DGXy9NIgZ-Ln15TAWgBenVYu8...

Thanks,
Murali

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Mseeram ,

 

I created three measures.

Target(min) =
CALCULATE (
    MIN ( 'Sample'[Cost] ),
    FILTER (
        ALL ( 'Sample' ),
        [Item Code] = MAX ( 'Sample'[Item Code] )
            && [Item Desc] = MAX ( 'Sample'[Item Desc] )
    )
)
Diff = SUM('Sample'[Cost])-[Target(min)]
Percentage = DIVIDE([Diff],SUM('Sample'[Cost]))

vstephenmsft_0-1648455013034.png

 

 

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.

View solution in original post

5 REPLIES 5
Whitewater100
Solution Sage
Solution Sage

Hi:

I struggled a bit and lost my steam. Here is what I have so far. I hope it helps

https://drive.google.com/file/d/1h_jhyWK0HcHaMB4fA0VdkDwmeZEXTJcK/view?usp=sharing 

Hi @Whitewater100 ,

Thanks for your response. 
Murali

Anonymous
Not applicable

Hi @Mseeram ,

 

Could you tell me if your problem has been solved?

If it is, kindly Accept the helpful reply as the solution. More people will benefit from it.

I downloaded the attachment of A and found that %Var is not displayed. I completed it.

vstephenmsft_0-1647503063035.png

 

 

 

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 @Anonymous 

Thanks for your response, if you see my original post I have 2 screen shots, 1st one I am selecting some sub vendors and taking min among them (not overall min) and in 2nd screen shot I have to put each sub vendor againest the selected min from the 1st screen shot and calculate the $difference and %difference.
I am reattaching the files here.
https://cscishell-my.sharepoint.com/:x:/g/personal/mseeram_csci_build/ERMK_KdRfGRFn3IAkTWsx14BQ5jnUMLFF_3mEt6J-kXnBQ?e=BkYG9q
https://cscishell-my.sharepoint.com/:u:/g/personal/mseeram_csci_build/ETsukNaxxbNJrqzeej5b4G8BMIp4Cmrd-7CuGVE01623zA?e=2GRJkS

Thanks,
Murali

Anonymous
Not applicable

Hi @Mseeram ,

 

I created three measures.

Target(min) =
CALCULATE (
    MIN ( 'Sample'[Cost] ),
    FILTER (
        ALL ( 'Sample' ),
        [Item Code] = MAX ( 'Sample'[Item Code] )
            && [Item Desc] = MAX ( 'Sample'[Item Desc] )
    )
)
Diff = SUM('Sample'[Cost])-[Target(min)]
Percentage = DIVIDE([Diff],SUM('Sample'[Cost]))

vstephenmsft_0-1648455013034.png

 

 

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.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.