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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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