Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hola amigos,
El archivo adjunto contiene datos recopilados Trimestre a Fecha, en otras palabras:
Archivo Pbix: QTD a Data.pbix mensual - Google Drive
Gracias
Ajinkya
Solved! Go to Solution.
@Ajinkya369, es posible que desee probar esta medida para obtener un total diferente,
Monthly Data =
SUMX (
DISTINCT ( 'QTD Data'[Month] ),
VAR __current_month = CALCULATE ( MAX ( 'QTD Data'[Month] ) )
VAR __current_sales = CALCULATE ( SUM ( 'QTD Data'[QTD Sales] ) )
RETURN
IF (
MOD ( MONTH ( __current_month ) , 3 ) = 1,
__current_sales,
VAR __prev_month =
MAXX (
FILTER ( ALL ( 'QTD Data'[Month] ), 'QTD Data'[Month] < __current_month ),
'QTD Data'[Month]
)
RETURN
__current_sales
- CALCULATE ( SUM ( 'QTD Data'[QTD Sales] ), 'QTD Data'[Month] = __prev_month )
)
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hey @CNENFRNL ,
En primer lugar gracias por responder, calculé el total de datos mensuales en Excel donde el total es : 295990 y veo
que no está coincidiendo con el total de la matriz PBI. Por favor, ayúdame más..
.Excel Total
Matriz PBI Total
@Ajinkya369, es posible que desee probar esta medida para obtener un total diferente,
Monthly Data =
SUMX (
DISTINCT ( 'QTD Data'[Month] ),
VAR __current_month = CALCULATE ( MAX ( 'QTD Data'[Month] ) )
VAR __current_sales = CALCULATE ( SUM ( 'QTD Data'[QTD Sales] ) )
RETURN
IF (
MOD ( MONTH ( __current_month ) , 3 ) = 1,
__current_sales,
VAR __prev_month =
MAXX (
FILTER ( ALL ( 'QTD Data'[Month] ), 'QTD Data'[Month] < __current_month ),
'QTD Data'[Month]
)
RETURN
__current_sales
- CALCULATE ( SUM ( 'QTD Data'[QTD Sales] ), 'QTD Data'[Month] = __prev_month )
)
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hola, @Ajinkya369
Como la columna de fecha consta de fechas poco contadas, las funciones de inteligencia de tiempo, como DATEADD, ENDOFMONTH, etc., no se aplican; por lo tanto, la medida es detallada y bastante complicada. Esta es una solución con el conjunto de datos original. Adjunte un archivo pbix como referencia.
Monthly Data =
VAR __current_sales = SUM ( 'QTD Data'[QTD Sales] )
RETURN
IF (
MOD ( MONTH ( MAX ( 'QTD Data'[Month] ) ), 3 ) = 1,
__current_sales,
VAR __current = MAX ( 'QTD Data'[Month] )
VAR __prev =
MAXX (
FILTER ( ALL ( 'QTD Data'[Month] ), 'QTD Data'[Month] < __current ),
'QTD Data'[Month]
)
RETURN
__current_sales
- CALCULATE ( SUM ( 'QTD Data'[QTD Sales] ), 'QTD Data'[Month] = __prev )
)
Sin tabla de fechas
Hola
Puede descargar mi archivo PBI desde aquí.
Espero que esto ayude.
Hola @Ajinkya369 ,
No estoy seguro de lo que estás tratando de hacer aquí. Si tiene un calendario en su pbix, puede utilizar funciones de Time Intelligence como TOTALQTD() como TOTALQTD(SUM(InternetSales_USD[SalesAmount_USD]),DateTime[DateKey])
https://docs.microsoft.com/en-us/dax/totalqtd-function-dax
Avísame si esto resuelve tu problema,
Si esto resuelve sus problemas, márquelo como la solución, para que otros puedan encontrarlo fácilmente. Kudos 👍son agradables también.
Nathaniel
Proud to be a Super User!