The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Buenas,
tengo una base de datos con las cantidades de venta de 3 diferentes productos.
La tabla contiene datos mensuales acumulados, pero me gustaría extraer los datos mensuales específicos (por ejemplo, datos acumulados de febrero - datos acumulados de enero = datos específicos de febrero).
Las columnas de la tabla son: Tipo de Producto -- País de Origen -- País de Venta -- Año -- Mes -- Cantidad (Kg).
No sé si la mejor opción sería crear una nueva columna condicional o una nueva medida, pero en ambos casos no consigo que me devuelva la "Cantidad (Kg)" no acumulada.
Solved! Go to Solution.
Hi @DavideChamp
If you don't have a date type column for month, you can first add a Month Start Date column in the table. For example with DAX:
Month Start = DATEVALUE([Year]&" "&[Month]&" 1")
Then create another calculated column with this DAX:
Monthly Qty =
'Table'[Quantity]
- MAXX (
FILTER (
'Table',
'Table'[Product Type] = EARLIER ( 'Table'[Product Type] )
&& 'Table'[Month Start] = EDATE ( EARLIER ( 'Table'[Month Start] ), -1 )
),
'Table'[Quantity]
)
If you want to add more conditions to above expression, use
Monthly Qty =
'Table'[Cantidad (Kg)]
- MAXX (
FILTER (
'Table',
'Table'[Tipo de Producto] = EARLIER ( 'Table'[Tipo de Producto] )
&& 'Table'[País de Origen] = EARLIER ( 'Table'[País de Origen] )
&& 'Table'[País de Venta] = EARLIER ( 'Table'[País de Venta] )
&& 'Table'[Month Start] = EDATE ( EARLIER ( 'Table'[Month Start] ), -1 )
),
'Table'[Cantidad (Kg)]
)
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Hi @DavideChamp
If you don't have a date type column for month, you can first add a Month Start Date column in the table. For example with DAX:
Month Start = DATEVALUE([Year]&" "&[Month]&" 1")
Then create another calculated column with this DAX:
Monthly Qty =
'Table'[Quantity]
- MAXX (
FILTER (
'Table',
'Table'[Product Type] = EARLIER ( 'Table'[Product Type] )
&& 'Table'[Month Start] = EDATE ( EARLIER ( 'Table'[Month Start] ), -1 )
),
'Table'[Quantity]
)
If you want to add more conditions to above expression, use
Monthly Qty =
'Table'[Cantidad (Kg)]
- MAXX (
FILTER (
'Table',
'Table'[Tipo de Producto] = EARLIER ( 'Table'[Tipo de Producto] )
&& 'Table'[País de Origen] = EARLIER ( 'Table'[País de Origen] )
&& 'Table'[País de Venta] = EARLIER ( 'Table'[País de Venta] )
&& 'Table'[Month Start] = EDATE ( EARLIER ( 'Table'[Month Start] ), -1 )
),
'Table'[Cantidad (Kg)]
)
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
User | Count |
---|---|
78 | |
77 | |
36 | |
32 | |
29 |
User | Count |
---|---|
93 | |
79 | |
57 | |
48 | |
48 |