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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
EDS
Helper I
Helper I

FORMUAL DAX

Buenos días, soy nuevo en Power bi y tengo una duda.

Es referente a tarifas de clientes.

Tengo una tabla de clientes, en la primera columna el codigo de cliente en la siguiente columna la tarifa cliente y en la otra grupo precio cliente.

CLIENTETARIFA CLIENTEGRUPO PRECIO CLIENTE
111001
221001
331001
4 1001

Por otro lado tengo una tarifa de precios que engloba tanto la tarifa de cliente como el grupo precio cliente.

TARIFASPRODUCTOTARIFA
1A3
2A4
3A2
1001A5

Me gustaria saber uan formula en DAX en la que para el cliente 1 producto A me pinte la tarifa de cliente es decir 3 y para el cliente 4 producto A me pinte 5.

Me explico quiero que lea para el cliente producto primero la tarifa de cliente y sí no encuentra la tarifa grupo precio cliente.

Sí tiene los dos informados siempre prevalece la tarifa cliente.

 

Gracias.

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @EDS 

Thanks for reaching out to us.

please try this measure,

Measure = 
var _product="A"
var _value= CALCULATE(MAX(Table2[TARIFA]),FILTER(Table2,Table2[TARIFAS]=MIN(Table1[CLIENTE]) && Table2[PRODUCTO]=_product))
return IF(ISBLANK(MIN(Table1[TARIFA CLIENTE])),_value,MIN(Table1[TARIFA CLIENTE]))

vxiaotang_0-1664507369981.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @EDS 

Thanks for reaching out to us.

please try this measure,

Measure = 
var _product="A"
var _value= CALCULATE(MAX(Table2[TARIFA]),FILTER(Table2,Table2[TARIFAS]=MIN(Table1[CLIENTE]) && Table2[PRODUCTO]=_product))
return IF(ISBLANK(MIN(Table1[TARIFA CLIENTE])),_value,MIN(Table1[TARIFA CLIENTE]))

vxiaotang_0-1664507369981.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

VahidDM
Super User
Super User

Hi   

It would be great if you submit your question on the Translated Spanish Desktop page:

https://community.powerbi.com/t5/Translated-Spanish-Desktop/bd-p/pbi_spanish_desktop

 

GT: 
Sería genial enviar su pregunta en la página de escritorio traducido al español:

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.