The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi Everyone,
I am new to the Power BI and Stuck in a situation. I need to find the price of the pack nearest to the filter, if exact pack size is not available.
I have attached the sample data in which I need to find the minimum price from all the countries. If two records are available for single country we need to find the nearest one on the basis of pack size and than basis the full list we need to find the minimum price.
I have mentioned the criteria below.
Solved! Go to Solution.
Hi @Anonymous
Please kindly check below results:
Flag_1 =
var a =
CALCULATE(MIN(Data[Abs_size]),ALLEXCEPT(Data,Data[Country]))
return
IF(Data[Abs_size]=a&&Data[Flag]=1,1,0)
Measure 2 =
IF(SELECTEDVALUE('HO Status'[HO Status])="Include HO",1,IF(SELECTEDVALUE(Data[HS Status])<>"HO",1,0))
Measure 3 = CALCULATE(MIN(Data[Unit_Price]),FILTER(Data,Data[Flag_1]=1&&[Measure 2]=1))*10
Pbix attached.
Hi @Anonymous
Please kindly check below results:
Flag_1 =
var a =
CALCULATE(MIN(Data[Abs_size]),ALLEXCEPT(Data,Data[Country]))
return
IF(Data[Abs_size]=a&&Data[Flag]=1,1,0)
Measure 2 =
IF(SELECTEDVALUE('HO Status'[HO Status])="Include HO",1,IF(SELECTEDVALUE(Data[HS Status])<>"HO",1,0))
Measure 3 = CALCULATE(MIN(Data[Unit_Price]),FILTER(Data,Data[Flag_1]=1&&[Measure 2]=1))*10
Pbix attached.
Hi Team,
Thank you soo much for your support on this. This is exactly what I am looking for.
I have one last question, how i can calculate average of 3 lowest price insted of minimum price is attached pbix file?
Abhik
Hi @Anonymous
you might consider creating pbix file that will contain some sample data (remove the confidential info), upload the pbix to onedrive or dropbox and share the link to the file. Please do not forget to describe the expected results based on this sample data.
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Sample data as text please.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
99 | |
81 | |
62 | |
54 |
User | Count |
---|---|
249 | |
119 | |
115 | |
94 | |
70 |