Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello,
Sorry if this was already replied in a previous post but I could not find anything... While creating a dax table, I can't find any way to add the column "Subtotal" which is the sum of the value for the same Dim1, would anyone has an idea?
Thanks,
Julien
Dim1 | Dim2 | Value | Subtotal |
A | #1 | 10 | 60 |
A | #2 | 20 | 60 |
A | #3 | 30 | 60 |
B | #4 | 40 | 150 |
B | #5 | 50 | 150 |
B | #6 | 60 | 150 |
My code looks like this:
Solved! Go to Solution.
Assuming T_1 is correct:
VAR T_2 =
ADDCOLUMNS (
T_1,
"Subtotal", SUMX ( FILTER ( T_1, [Dim1] = EARLIER ( [Dim1] ) ), [Value] )
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Thanks a lot! I got lost with the use of "Filter" 🙂
Assuming T_1 is correct:
VAR T_2 =
ADDCOLUMNS (
T_1,
"Subtotal", SUMX ( FILTER ( T_1, [Dim1] = EARLIER ( [Dim1] ) ), [Value] )
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
86 | |
84 | |
66 | |
62 | |
60 |
User | Count |
---|---|
197 | |
118 | |
108 | |
78 | |
69 |