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 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?
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 |
---|---|
105 | |
94 | |
75 | |
63 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |