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.
Hi friends.
I have the following table:
And I need to show it like this:
The columns "PLAN AC" and "REAL AC" are running totals of PLAN and REAL.
Thanks for your help!
Solved! Go to Solution.
HI @MauroBote
For your case, just create two inactive relationship with date table.
Then create four measure as below:
PLAN = CALCULATE(SUM('Table'[PESO]),USERELATIONSHIP('Date'[Date],'Table'[PECHA PLAN]),'Table'[PECHA PLAN]<>BLANK())
REAL = CALCULATE(SUM('Table'[PESO]),USERELATIONSHIP('Date'[Date],'Table'[FECHA REAL]),'Table'[FECHA REAL]<>BLANK())
PLAN AC = CALCULATE([PLAN],FILTER(ALLSELECTED('Date'[Date]),'Date'[Date]<=MAX('Date'[Date])))
REAL AC = CALCULATE([REAL],FILTER(ALLSELECTED('Date'[Date]),'Date'[Date]<=MAX('Date'[Date])))
Result:
Regards,
Lin
HI @MauroBote
For your case, just create two inactive relationship with date table.
Then create four measure as below:
PLAN = CALCULATE(SUM('Table'[PESO]),USERELATIONSHIP('Date'[Date],'Table'[PECHA PLAN]),'Table'[PECHA PLAN]<>BLANK())
REAL = CALCULATE(SUM('Table'[PESO]),USERELATIONSHIP('Date'[Date],'Table'[FECHA REAL]),'Table'[FECHA REAL]<>BLANK())
PLAN AC = CALCULATE([PLAN],FILTER(ALLSELECTED('Date'[Date]),'Date'[Date]<=MAX('Date'[Date])))
REAL AC = CALCULATE([REAL],FILTER(ALLSELECTED('Date'[Date]),'Date'[Date]<=MAX('Date'[Date])))
Result:
Regards,
Lin
You could connect both dates to the Calendar table. This would create a inactive relationship which you could get around using USERELATIONSHIP.
That being said, it would be very easy to just leave the tables completely unrelated and do this:
PLAN AC =
VAR __Table = FILTER('Table1','Table1'[FECHA PLAN]<='Table2'[CALENDARIO])
RETURN
SUMX(__Table,[PESO])
REAL AC =
VAR __Table = FILTER('Table1','Table1'[FECHA REAL]<='Table2'[CALENDARIO])
RETURN
SUMX(__Table,[PESO])
You can connect both tables to the same date calendar and use userelation and cross filter as per need. Please find my example on mu blog on similar lines
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 |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |