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.
I have this data:
Date | MasterCategory | SubCategory | Amount |
8-August-2022 | Food | Grocery | 200 |
8-August-2022 | Food | Grocery | 31 |
8-August-2022 | Food | Restaurant | 40 |
8-August-2022 | Shopping | Electronics | 30 |
9-August-2022 | Food | Grocery | 10 |
10-August-2022 | Shopping | Electronics | 5 |
11-August-2022 | Food | Restaurant | 10 |
12-August-2022 | Shopping | Grocery | 10 |
My goal is to generate
Date | MasterCategory | SubCategory | Total Amount |
2022-08-08 00:00:00 | Food | Grocery | 231 |
2022-08-08 00:00:00 | Food | Restaurant | 40 |
2022-08-08 00:00:00 | Shopping | Electronics | 30 |
2022-08-08 00:00:00 | Shopping | Grocery | 0 |
2022-08-09 00:00:00 | Food | Grocery | 10 |
2022-08-09 00:00:00 | Food | Restaurant | 0 |
2022-08-09 00:00:00 | Shopping | Electronics | 0 |
2022-08-09 00:00:00 | Shopping | Grocery | 0 |
2022-08-10 00:00:00 | Food | Grocery | 0 |
2022-08-10 00:00:00 | Food | Restaurant | 0 |
2022-08-10 00:00:00 | Shopping | Electronics | 5 |
2022-08-10 00:00:00 | Shopping | Grocery | 0 |
2022-08-11 00:00:00 | Food | Grocery | 0 |
2022-08-11 00:00:00 | Food | Restaurant | 10 |
2022-08-11 00:00:00 | Shopping | Electronics | 0 |
2022-08-11 00:00:00 | Shopping | Grocery | 0 |
2022-08-12 00:00:00 | Food | Grocery | 0 |
2022-08-12 00:00:00 | Food | Restaurant | 0 |
2022-08-12 00:00:00 | Shopping | Electronics | 0 |
2022-08-12 00:00:00 | Shopping | Grocery | 10 |
I have almost hit the goal but now I am running into this error within my linked solution:
Most likely being caused by last line of the data.
I hope someone can provide a solution here.
Solved! Go to Solution.
Hi @farooqk
Please remove the relationship first, then use this DAX expression to create a new table:
New Table =
VAR _Date =
VALUES ( Data[Date] )
VAR _Cat =
SUMMARIZE ( Data, Data[MasterCategory], Data[SubCategory] )
RETURN
ADDCOLUMNS (
CROSSJOIN ( _Date, _Cat ),
"Amount", CALCULATE ( SUM ( Data[Amount] ), KEEPFILTERS ( Data[Date] ) ) + 0
)
The output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hi @farooqk
Please remove the relationship first, then use this DAX expression to create a new table:
New Table =
VAR _Date =
VALUES ( Data[Date] )
VAR _Cat =
SUMMARIZE ( Data, Data[MasterCategory], Data[SubCategory] )
RETURN
ADDCOLUMNS (
CROSSJOIN ( _Date, _Cat ),
"Amount", CALCULATE ( SUM ( Data[Amount] ), KEEPFILTERS ( Data[Date] ) ) + 0
)
The output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Thanks for the help!
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 |
---|---|
100 | |
99 | |
80 | |
77 | |
66 |
User | Count |
---|---|
134 | |
106 | |
104 | |
85 | |
73 |