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.
I have a live data table with a limit of days of history and a history table where the data is written a few days before it is deleted from the live table
For example, my data looks like this
Container | Date | Table1_Live_units | Table2_history_units |
A | 05/05/2017 | 0 | 23 |
B | 05/06/2017 | 15 | 15 |
C | 05/07/2017 | 30 | 0 |
I want to obtain the following table
Container | Date | Units | |
A | 05/05/2017 | 23 | |
B | 05/06/2017 | 15 | |
C | 05/07/2017 | 30 |
What's the best way to do this on Power BI?
SUMMARIZE?
Solved! Go to Solution.
Solved
Unidades = IF(RELATED(CI_Unidades[CONTAINER_ID])<>"";CALCULATE(SUM(CI_Unidades[SUM(UNIT_QTY)]);FILTER(CI_Unidades;CI_Unidades[CONTAINER_ID]=EARLIER(Reprocessamento_18072017[CB])));IF(RELATED(CH_Unidades[CONTAINER_ID])<>"";CALCULATE(SUM(CH_Unidades[Unidades]);FILTER(CH_Unidades;CH_Unidades[CONTAINER_ID]=EARLIER(Reprocessamento_18072017[CB])))))
Solved
Unidades = IF(RELATED(CI_Unidades[CONTAINER_ID])<>"";CALCULATE(SUM(CI_Unidades[SUM(UNIT_QTY)]);FILTER(CI_Unidades;CI_Unidades[CONTAINER_ID]=EARLIER(Reprocessamento_18072017[CB])));IF(RELATED(CH_Unidades[CONTAINER_ID])<>"";CALCULATE(SUM(CH_Unidades[Unidades]);FILTER(CH_Unidades;CH_Unidades[CONTAINER_ID]=EARLIER(Reprocessamento_18072017[CB])))))