Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I am using my data model with both Power BI and PowerPivot, thus why I am posting here.
Here is an example of my data structure. I have the first 3 columns in my data table. I am trying to write a measure that will allow me to generate the 4th column, which is the sum of "Value1" within each date group. This seems like it should be simple, but everything I try returns the original "Value1" for each row instead of the group aggregate. Thanks for your help.
Date | Obs | Value 1 | SumDatexValue |
1/1/2019 | 1 | 200 | 750 |
1/1/2019 | 2 | 300 | 750 |
1/1/2019 | 3 | 250 | 750 |
1/2/2019 | 1 | 600 | 2000 |
1/2/2019 | 2 | 500 | 2000 |
1/2/2019 | 3 | 900 | 2000 |
Solved! Go to Solution.
Hi @mrlang02
It sounds like you need a calculated column rather than a measure. Try this:
SumDatexValue =
CALCULATE ( SUM ( Table1[Value1] ), ALLEXCEPT ( Table1, Table1[Date] ) )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Hi @mrlang02
It sounds like you need a calculated column rather than a measure. Try this:
SumDatexValue =
CALCULATE ( SUM ( Table1[Value1] ), ALLEXCEPT ( Table1, Table1[Date] ) )
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
Thank you so much this works perfectly. Appears I can use this as either a calculated column or measure and it achieves what I need.
In general, I've read that using measures whenever you can will improve calculation times, thus why I was taking that approach. But very helpful to know I can do it either way.