The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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)
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
94 | |
80 | |
63 | |
56 |
User | Count |
---|---|
248 | |
122 | |
110 | |
77 | |
70 |