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 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.
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 |
---|---|
47 | |
24 | |
20 | |
15 | |
12 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
18 |