Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi everybody,
I need to classified the difference between 2 dates: today and the last order date.
Ir order to do so, I was trying to use this DAX formula:
Serves Clasification =
Solved! Go to Solution.
Hi @Maricel
is this a measure or a calculated? The variable Daywithoutserve is not used. The syntax of the SWITCH statement is not correct, normally it should be SWITCH ( TRUE (), ...... however, it is not clear what are you trying to achieve by inserting the [Días sin pedir] measure into the switch statement. What is Estado?
Hi, @Maricel
[Días sin pedir] is of integer type and result of Consumo[Consumo diario en el último años]<=?? is of type boolean, so you can't compare them.
If [Días sin pedir] is the difference between the two dates, you can try something like:
Measure:
Serves Clasification =
VAR Daywithoutserve = [Días sin pedir]
VAR Status =
SWITCH (
TRUE (),
Daywithoutserve <= 30, "No servir",
Daywithoutserve <= 60, "Posible",
Daywithoutserve <= 90, "Servir"
)
RETURN
Estado
Best Regards,
Community Support Team _ Eason
Hi @Maricel
is this a measure or a calculated? The variable Daywithoutserve is not used. The syntax of the SWITCH statement is not correct, normally it should be SWITCH ( TRUE (), ...... however, it is not clear what are you trying to achieve by inserting the [Días sin pedir] measure into the switch statement. What is Estado?
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
31 | |
19 | |
15 | |
7 | |
6 |