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.
Hi there! I have a model in which I group clients according to an identifier ("Class") this in the table customers on the other hand I have the table sales and here the transactions are registered by customer number I need to formulate a measure that compares the consumption and classify customers according to the group ("Class") as increment, decrement, etc. based on this comparison that in the first instance works but applies only at the client level and I require it by level ("Class") please guide me how to achieve it.
The measure I use is as follows:
=SWITCH(TRUE(),AND(CALCULATE(Sales[Consumo Anterior])>0,CALCULATE(Sales[Consumo Actual])>0), SWITCH(TRUE(), CALCULATE(Sales[Consumo Anterior])>CALCULATE(Sales[Consumo Actual]),"Decremento", CALCULATE(Sales[Consumo Anterior])<CALCULATE(Sales[Consumo Actual]),"Incremento", CALCULATE(Sales[Consumo Anterior])=CALCULATE(Sales[Consumo Actual]),"Sin Crecim.", BLANK()), AND(CALCULATE(Sales[Consumo Anterior])<=0,CALCULATE(Sales[Consumo Actual])>0), SWITCH(TRUE(), CALCULATE(Sales[Consumo Anterior])<CALCULATE(Sales[Consumo Actual]),"Nuevo", BLANK()), AND(CALCULATE(Sales[Consumo Anterior])>0,CALCULATE(Sales[Consumo Actual])<=0), SWITCH(TRUE(), CALCULATE(Sales[Consumo Anterior])>CALCULATE(Sales[Consumo Actual]),"Perdido", BLANK()), AND(CALCULATE(Sales[Consumo Anterior])<=0,CALCULATE(Sales[Consumo Actual])<=0),"Sin Mov", BLANK())
Hi @Anonymous ,
Based on your formula, I could understand your logic and I'm afraid that the result should be right based on your measure
To get your solution quickly, if it is convenient, could you share some data sample which could reproduce the scenario with table format so that i could copy and have a test on it?
In addition, you'd better describe your logic again so that I can understand better to write the formula.
Best Regards,
Cherry
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |