Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I'm using 2 Tables for this, Calendar and Plan.
Calendar has the usual:
Date | Year | MonthNum | Month | Weekday | Day | Week | DayOfYear |
Sunday, January 1, 2023 | 2023 | 1 | jan | 6 | 1 | 1 | 1 |
Monday, January 2, 2023 | 2023 | 1 | jan | 0 | 2 | 2 | 2 |
Tuesday, January 3, 2023 | 2023 | 1 | jan | 1 | 3 | 2 | 3 |
... |
Id | Amount | Weekday |
1 | 1 | 0 |
1 | 1 | 1 |
1 | 1 | 2 |
1 | 1 | 3 |
1 | 1 | 4 |
1 | 1 | 5 |
1 | 1 | 6 |
2 | 3 | 0 |
2 | 3 | 1 |
2 | 3 | 2 |
2 | 3 | 3 |
2 | 3 | 4 |
2 | 3 | 5 |
2 | 3 | 6 |
3 | 8 | 0 |
3 | 8 | 2 |
3 | 8 | 4 |
4 | 6 | 0 |
4 | 6 | 2 |
4 | 6 | 4 |
5 | 11 | 5 |
5 | 11 | 6 |
6 | 9 | 1 |
6 | 9 | 3 |
The relationship I'm using between tables for now is Weekday - Weekday (a many to many, as you can imagine).
The measure for now is:
TotalAmount = CALCULATE(SUM(Plan[Amount]))
So, the thing is, if I display a Matrix for TotalAmount by Id against Date works fine on a daily or weekly basis but fails for month and year totals, it looks as following:
How would you go about getting it right also on a monthly and yearly basis?
Do I need to adjust TotalAmount measure?
@poweringthru , Does your second table has a date ? why do you need populate weekday to ID?
can you make sure your date to join(calendar date and fact date) is correct? Because if the data is correct at the date of the calendar, it should rollup correctly
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Hey, thank you for answering!
Plan table is Weekday driven, rows don't have a specific date. I need it to apply to any given month and year.
Here is a test pbix document in a WeTransfer link:
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
104 | |
98 | |
97 | |
38 | |
38 |
User | Count |
---|---|
153 | |
122 | |
76 | |
73 | |
66 |