Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
Trying to acheive something like this in "New Column", using a DAX function.
I want to sum the Sales values for matching Year, Month, and Cat1 rows.
Year | Month | Cat1 | Cat2 | Sales | New Column |
2019 | Feb | Quick | Fizz | 1 | 3 |
2019 | Feb | Quick | Buzz | 2 | 3 |
2019 | Feb | Brown | Fizz | 3 | 7 |
2019 | Feb | Brown | Buzz | 4 | 7 |
2019 | March | Quick | Fizz | 5 | 11 |
2019 | March | Quick | Buzz | 6 | 11 |
2019 | March | Brown | Fizz | 7 | 15 |
2019 | March | Brown | Buzz | 8 | 15 |
Thanks!
Solved! Go to Solution.
Hi @igreeinf ,
You also could try this calculated column.
Column = CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Year] = EARLIER ( 'Table'[Year] ) && 'Table'[Month] = EARLIER ( 'Table'[Month] ) && 'Table'[Cat1] = EARLIER ( 'Table'[Cat1] ) ) )
Here is the output.
Hope this can help you.
Best Regards,
Cherry
Hi @igreeinf ,
You also could try this calculated column.
Column = CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Year] = EARLIER ( 'Table'[Year] ) && 'Table'[Month] = EARLIER ( 'Table'[Month] ) && 'Table'[Cat1] = EARLIER ( 'Table'[Cat1] ) ) )
Here is the output.
Hope this can help you.
Best Regards,
Cherry
Thanks @az38! I tried that and it worked before, but it's giving me values for Sales that don't exist at all, which is strange.
Any insight?
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |