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.
Hello,
I have two tables with different columns. I try to list the total price in table 1 (total price 2018) and the total price from table 2(total price 2017) in a bar chart. So people can look at current year's total price and the previous year. I only need to compare monthly i.e. 2018 Jan compares to 2017Jan. I mange to learn "SAMEPERIODLASTYEAR" but no joys because I have two tables rather than one.
Unfortunately, I cannot attach pbix file but both tasble can be see here:
Date | Assessment | Price | Assessor | Modification date |
01/01/2018 | A | 10 | ||
11/01/2018 | B | 10 | ||
21/01/2018 | C | 10 | ||
01/02/2018 | A | 20 | ||
11/02/2018 | B | 20 | ||
21/02/2018 | C | 20 |
Date | Assessment | Price |
01/01/2017 | E | 100 |
11/01/2017 | F | 100 |
21/01/2017 | G | 100 |
I tried to put both price in the both tables together. Somehow, the total price in 2017 appears when the date is 2018.
Could someone help? "SAMEPERIODLASTYEAR" won't work becasue I have two tables. By the way, is there a way to attach file / picture?
Solved! Go to Solution.
Hi @rickylee,
We need a Date table in your scenario. Then these two tables will be connected through the date table. Either of the two measure below will be OK.
Calendar = CALENDARAUTO()
Measure = CALCULATE ( SUM ( Table2[Price] ), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
Measure = CALCULATE ( SUM ( Table1[Price] ) + SUM ( Table2[Price] ), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
Best Regards,
Dale
Hi @rickylee,
We need a Date table in your scenario. Then these two tables will be connected through the date table. Either of the two measure below will be OK.
Calendar = CALENDARAUTO()
Measure = CALCULATE ( SUM ( Table2[Price] ), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
Measure = CALCULATE ( SUM ( Table1[Price] ) + SUM ( Table2[Price] ), SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )
Best Regards,
Dale
It works perfectly!
Thank you.
Kind regards,
Ricky
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 |
---|---|
113 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |