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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Cómo encontrar la coincidencia y el valor más cercanos

Hola a todos,

Soy nuevo en Power BI y Stuck en una situación. Necesito encontrar el precio del paquete más cercano al filtro, si el tamaño exacto del paquete no está disponible.

He adjuntado los datos de muestra en los que necesito encontrar el precio mínimo de todos los países. Si hay dos registros disponibles para un solo país, necesitamos encontrar el más cercano en función del tamaño del paquete y que no sea la base de la lista completa necesitamos encontrar el precio mínimo.

He mencionado los criterios a continuación.

Data Table.pngFilter Criteria.png

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hola @Abhik

Por favor, compruebe los siguientes resultados:

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

6.PNG

Pbix adjunto.

Community Support Team _ Dina Ye
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
v-diye-msft
Community Support
Community Support

Hola @Abhik

Por favor, compruebe los siguientes resultados:

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

6.PNG

Pbix adjunto.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Hola Equipo,

Muchas gracias por su apoyo en esto. Esto es exactamente lo que estoy buscando.

Tengo una última pregunta, ¿cómo puedo calcular el promedio de 3 precio más bajo en lugar del precio mínimo se adjunta archivo pbix?

Abhik

v-diye-msft
Community Support
Community Support

Hola @Abhik

podría considerar la creación de un archivo pbix que contendrá algunos datos de ejemplo (eliminar la información confidencial), cargar el pbix en onedrive o dropbox y compartir el enlace al archivo. No olvide describir los resultados esperados en función de estos datos de ejemplo.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Greg_Deckler
Community Champion
Community Champion

Por favor, consulte este post sobre cómo obtener su pregunta respondida rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Ejemplo de datos como texto por favor.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hola Greg,

He añadido el enlace de archivo a continuación para su referencia. Enlace

Saludos

Abhik

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors