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.
Estoy trabajando datos que tienen dos fact_tables llamadas fact_stat y fact_dyn. Fact_stat solo tiene una fecha unidimensional (report_date) y fact_dyn tiene fechas bidimensionales (report_date & forecast_date). ¿Cómo puedo construir una medida que me da resultados como en la primera imagen a continuación? La medida "Dyn_all" debe mantener fact_stat valor igual durante las fechas de pronóstico. Medidas que estoy usando:
Con las medidas actuales sólo puedo ver resultados:
Fact_dyn tabla:
Report_Date | Forecast_Date | importe | cartera |
30.4.2020 | 30.4.2020 | 100 | A |
30.4.2020 | 30.4.2020 | 150 | B |
30.4.2020 | 30.4.2020 | 200 | C |
30.4.2020 | 1.5.2020 | 150 | A |
30.4.2020 | 1.5.2020 | 200 | B |
30.4.2020 | 1.5.2020 | 250 | C |
30.4.2020 | 2.5.2020 | 200 | A |
30.4.2020 | 2.5.2020 | 250 | B |
30.4.2020 | 2.5.2020 | 300 | C |
Fact_stat tabla:
Report_Date | importe | cartera |
30.4.2020 | 400 | D |
15.5.2020 | 200 | D |
Flujo de datos:
Hola @Oopa ,
De acuerdo con su solicitud, es mejor que primero cree una tabla anexa como se muestra a continuación:
A continuación, cree una tabla de dimensiones como se indica a continuación:
Table 2 = DISTINCT('Append1'[Portfolio])
Por último, cree 2 medidas como se indica a continuación:
ReplaceToZero = CALCULATE(SUM('Append1'[Amount]),'Append1','Append1'[Portfolio] in DISTINCT('Table 2'[Portfolio]))+0
ReplaceToValue = IF(CALCULATE(COUNTROWS('Append1'),FILTER('Append1','Append1'[Portfolio] in DISTINCT('Table 2'[Portfolio])))=0,MAXX(SUMMARIZE(FILTER(ALLSELECTED('Append1'),'Append1'[Portfolio] in DISTINCT('Table 2'[Portfolio])),'Append1'[Forecast_Date],"measure",CALCULATE(SUM('Append1'[Amount]),FILTER('Append1','Append1'[Portfolio] in DISTINCT('Table 2'[Portfolio])))),[measure]),'Table 2'[ReplaceToZero])
Y verás:
Para el archivo .pbix relacionado, haga clic aquí.
@v-kelly-msft, gracias por su respuesta. Puedo ver los resultados correctos de su powerBI. El único menor es que ahora estamos usando la fecha de previsión e informe de la tabla Append1 y no de dim_report_date o dim_forecast_date. ¿Alguna solución para hacer eso? De lo contrario, esto podría causar problemas si queremos ver otros datos que se unen también a estas tablas de dim_report_date y dim_forecast_date.
@Oopa compartir datos sin procesar, debe tener dimensión de fecha en el modelo para que todo funcione.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Oopa compartir usando una unidad / google drive.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k , Los datos de ejemplo son bastante simples:
Fact_dyn:
Report_Date | Forecast_Date | Cantidad | Cartera |
30.4.2020 | 30.4.2020 | 100 | A |
30.4.2020 | 30.4.2020 | 150 | B |
30.4.2020 | 30.4.2020 | 200 | C |
30.4.2020 | 1.5.2020 | 150 | A |
30.4.2020 | 1.5.2020 | 200 | B |
30.4.2020 | 1.5.2020 | 250 | C |
30.4.2020 | 2.5.2020 | 200 | A |
30.4.2020 | 2.5.2020 | 250 | B |
30.4.2020 | 2.5.2020 | 300 | C |
Fact_stat:
Report_Date | Cantidad | Cartera |
30.4.2020 | 400 | D |
15.5.2020 | 200 | D |
Flujo de datos:
@Oopa , consulte cómo unir dos fechas a la misma hora atenuar y utilizarlas usando userelation
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 |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |