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.
hola! Tengo una tabla con valores acumulados por fecha, es decir tengo una columna fecha y otra columna valor. Mi pregunta es como puedo restar 2 valores entre diferentes fechas? Por ejemplo: Fecha. Valor acumulado
1 Diciembre 2019. 20
5 Enero 2020. 30
2 Febrero 2020. 40
3 Abril 2020 120
Como podria hacerlo si quiero restar por ejemplo el valor del 3 de abril menos el del 1 de diciembre de 2019? Gracias
Solved! Go to Solution.
Hi @coryan ,
You can create a measure as below:
Difference =
VAR _minvalue =
CALCULATE (
MAX ( 'Ttable'[Accumulated value] ),
FILTER ( 'Ttable', 'Ttable'[Date] = MIN ( 'Ttable'[Date] ) )
)
VAR _maxvalue =
CALCULATE (
MAX ( 'Ttable'[Accumulated value] ),
FILTER ( 'Ttable', 'Ttable'[Date] = MAX ( 'Ttable'[Date] ) )
)
RETURN
_maxvalue - _minvalue
Best Regards
Rena
Hi @coryan ,
You can create a measure as below:
Difference =
VAR _minvalue =
CALCULATE (
MAX ( 'Ttable'[Accumulated value] ),
FILTER ( 'Ttable', 'Ttable'[Date] = MIN ( 'Ttable'[Date] ) )
)
VAR _maxvalue =
CALCULATE (
MAX ( 'Ttable'[Accumulated value] ),
FILTER ( 'Ttable', 'Ttable'[Date] = MAX ( 'Ttable'[Date] ) )
)
RETURN
_maxvalue - _minvalue
Best Regards
Rena
I have the same problem, but I need to know if the result of the difference is positive or negative, so, I think that I should not use MAXX and MINX ¿Do you know how can I solve it?
Example:
1 Diciembre 2019. 20
5 Enero 2020. 30
2 Febrero 2020. 40
3 Abril 2020 120
5 Mayo 2020 50
If I want to know the difference between Mayo and Enero, the result will be 20 (50-20), but if I took Mayo and Abril the result should be -70 (50-120), in order to know if I have proffit or loss.
@coryan , These formula's can help
Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
or
Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Day))
or
Last Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
or
Last Day = CALCULATE(sum('order'[Qty]), previousday('Date'[Date]))
This Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
refer by blog, the column way is also given
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 |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |