Forum Discussion
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.
| CLIENTE | TARIFA CLIENTE | GRUPO PRECIO CLIENTE |
| 1 | 1 | 1001 |
| 2 | 2 | 1001 |
| 3 | 3 | 1001 |
| 4 | 1001 |
Por otro lado tengo una tarifa de precios que engloba tanto la tarifa de cliente como el grupo precio cliente.
| TARIFAS | PRODUCTO | TARIFA |
| 1 | A | 3 |
| 2 | A | 4 |
| 3 | A | 2 |
| 1001 | A | 5 |
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.
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]))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.
2 Replies
- v-xiaotangCommunity 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]))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.
- VahidDMSuper 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!!