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,
I have a table with month,activity and value columns.
Month | Activity | Value | ValueTotal |
Jan | A | 9212 | 17282 |
Jan | A | 9212 | 17282 |
Jan | B | 5746 | 17282 |
Jan | B | 5746 | 17282 |
Jan | C | 1752 | 17282 |
Jan | C | 1752 | 17282 |
Jan | D | 572 | 17282 |
Jan | D | 572 | 17282 |
Feb | A | 25096 | 59342 |
Feb | A | 25096 | 59342 |
Feb | B | 23650 | 59342 |
Feb | B | 23650 | 59342 |
Feb | C | 7109 | 59342 |
Feb | C | 7109 | 59342 |
Feb | D | 3487 | 59342 |
Feb | D | 3487 | 59342 |
Mar | A | 27083 | 68068 |
Mar | A | 27083 | 68068 |
Mar | B | 28860 | 68068 |
Mar | B | 28860 | 68068 |
Mar | C | 6852 | 68068 |
Mar | C | 6852 | 68068 |
Mar | D | 5273 | 68068 |
Mar | D | 5273 | 68068 |
I would like to have calculated column to sum on distinct Value based on month coulumn,
the result expected is of ValueTotal column
i was able to take the distinct value and sum but unable to add filter on month before sum
ValueTotal= SUMX(SUMMARIZE('Table1','Table1'[Value]),'Table1'[value])
Solved! Go to Solution.
Hi, @sheenajose , you might want to try this formula in a calcaulated column,
TotalDistinctValue =
SUMX (
CALCULATETABLE (
DISTINCT ( 'Table1'[Value] ),
ALLEXCEPT ( 'Table1', 'Table1'[Month] )
),
'Table1'[Value]
)
or equally,
TotalDistinctValue 2 =
SUMX (
CALCULATETABLE (
DISTINCT ( Table1[Value] ),
FILTER ( Table1, [Month] = EARLIER ( Table1[Month] ) )
),
Table1[Value]
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi, @sheenajose , you might want to try this formula in a calcaulated column,
TotalDistinctValue =
SUMX (
CALCULATETABLE (
DISTINCT ( 'Table1'[Value] ),
ALLEXCEPT ( 'Table1', 'Table1'[Month] )
),
'Table1'[Value]
)
or equally,
TotalDistinctValue 2 =
SUMX (
CALCULATETABLE (
DISTINCT ( Table1[Value] ),
FILTER ( Table1, [Month] = EARLIER ( Table1[Month] ) )
),
Table1[Value]
)
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
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 |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |