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 guys. I´m new in this forum though I´ve got some answers since months.
My problem is that I want to create a new column in a new table I´ve calculated. This new column should take the value of the column Total_Ventas but for the year previous only when the column Index is different form 1. Getting this I could calculate a new column that measure the variation between the actual year and the previous one. In the image attach is a sample of my dataset and the column "Wish" is the one that I want to create. I have tryed with the following DAX expression but what I get is wrong.
Venta_Previa = CALCULATE(MAX('Totales_Año_Cliente_Articulos'[Total_Ventas]),FILTER('Totales_Año_Cliente_Articulos','Totales_Año_Cliente_Articulos'[Index]<EARLIER('Totales_Año_Cliente_Articulos'[Index])))
@Jsua,
Firstly, add another Index column from 1 to 20 in your table.
Secondly, based on your above screenshot, I am not sure if the TIENDA column contains numbers like 2012, 2013 and so on, if not, create wish column using the following formula.
Wish = IF('Totales_Año_Cliente_Articulos'[TIENDA]=LOOKUPVALUE('Totales_Año_Cliente_Articulos'[TIENDA],'Totales_Año_Cliente_Articulos'[Index.1],'Totales_Año_Cliente_Articulos'[Index.1]-1),LOOKUPVALUE('Totales_Año_Cliente_Articulos'[Total_Ventas],'Totales_Año_Cliente_Articulos'[Index.1],'Totales_Año_Cliente_Articulos'[Index.1]-1),0)
However, if the value of TIENDA column is like “2012Avboyaca”, then create a column using the following formula.
Column = RIGHT('Totales_Año_Cliente_Articulos'[TIENDA],LEN('Totales_Año_Cliente_Articulos'[TIENDA])-4)
Then create wish column using the formula below.
Wish = IF('Totales_Año_Cliente_Articulos'[Column]=LOOKUPVALUE('Totales_Año_Cliente_Articulos'[Column],'Totales_Año_Cliente_Articulos'[Index.1],'Totales_Año_Cliente_Articulos'[Index.1]-1),LOOKUPVALUE('Totales_Año_Cliente_Articulos'[Total_Ventas],'Totales_Año_Cliente_Articulos'[Index.1],'Totales_Año_Cliente_Articulos'[Index.1]-1),0)
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |