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.
Hello!
I am working with a sales base that contains all the sales of an eccommerce, this one is already worked previously and then uploaded to Power Bi.
What I want to do is two data cards, where it shows me the cumulative sales of the month and the cumulative sales of the day. To complement I want these to be colored green, if the cumulative sale of the month is greater than last month and if the sale of today is greater than the sale of the same day but last month, otherwise it is in red.
I am using the following measures
Ventas Totales = SUM(Tabla[Ventas])
Ventas Mes Anterior =
CALCULATE([Ventas Totales],
PREVIOUSMONTH(Ventas[Fecha]),
REMOVEFILTERS(Ventas))
KPI MES = SWITCH(
TRUE(),
[Ventas Totales] < [Ventas Mes Anterior] , "#ff0000",
[Ventas Totales] > [Ventas Mes Anterior] , "#009900",
"FFFF00"
)
Ventas Dia y Mes Anterior = CALCULATE([Ventas Totales],
DATEADD(Ventas[Fecha],-1,MONTH)
)
KPI DIAS= SWITCH(
TRUE(),
[Ventas Totales] < [Ventas Dia y Mes Anterior] , "#ff0000",
[Ventas Totales] > [Ventas Dia y Mes Anterior] , "#009900",
"FFFF00"
)
When formatting a card object, it works as I want it to, but the problem is when I add a filter object that contains the categories of the products sold (Shirts, Pants, Jackets, etc.). When selecting a category to filter all the objects, they do not behave as they should (In the image the months with yellow color should be green and not Red).
If someone could help me with the right measurement so that when filtering I do the calculation well, I would appreciate them.
Your screenshot is not very clear. Could you share a sample with me and show me a clear screenshot with the result you want? This will make it easier for me to understand your requirement.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Syndicate_Admin , You should use a date table, Is there any reason to use all on table
example
Ventas Mes Anterior =
CALCULATE([Ventas Totales],
PREVIOUSMONTH(Fecha[Fecha]))
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw
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 |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |