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 would like to compute a cumulative sum for "amount per person" month by month.
My measure for computing "Cumulative Amout Per person" is wrong because, for instance, for month 2, it is doing (114 + 267) / (112 + 129). Instead of 1,02 + 2,07
Do you know if it is possible to get this result ?
My formula are :
Solved! Go to Solution.
Hi,@Thomas94401
Please confirm whether this output is correct.
Cumulative_Amount_per_person =
CALCULATE (
SUM ( 'Table'[Amount_per_person] ),
FILTER ( 'Table', 'Table'[Month] <= EARLIER ( 'Table'[Month] ) )
)
Best Regards,
Community Support Team _Charlottez
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Thomas94401
I may be misunderstanding what you are requesting, however, the measures you have created are correct in what they are calculating. I believe you need to modify your Sales_P1 and Pop_P1 measures to the following:
Sales_P1 = TOTALYTD ( SUM ( 'Sales'[Conso] ) , 'Date'[Date] )
Pop_P1 = TOTALYTD (SUM ( 'Population'[Pop] ) , 'Date'[Date] )
Give the above a go and hopefully that resolves it 🙂
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Hi @Thomas94401
I may be misunderstanding what you are requesting, however, the measures you have created are correct in what they are calculating. I believe you need to modify your Sales_P1 and Pop_P1 measures to the following:
Sales_P1 = TOTALYTD ( SUM ( 'Sales'[Conso] ) , 'Date'[Date] )
Pop_P1 = TOTALYTD (SUM ( 'Population'[Pop] ) , 'Date'[Date] )
Give the above a go and hopefully that resolves it 🙂
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Hi,@Thomas94401
You can try the following methods.
Cumulative_Amount_per_person =
CALCULATE (
SUM ( 'Table'[Sales_P1] ),
FILTER ( 'Table', 'Table'[Month] <= EARLIER ( 'Table'[Month] ) )
)
/ CALCULATE (
SUM ( 'Table'[Amount_per_person] ),
FILTER ( 'Table', 'Table'[Month] <= EARLIER ( 'Table'[Month] ) )
)
If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?
Best Regards,
Community Support Team _Charlottez
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi v-zhangti,
Thanks for your reply !
Unfortunely, what I want in the column Cumulative_Amount_per_people is 😀
Cumulative_Amount_per_people |
1,02 |
3,09 |
5,97 |
Hi @Thomas94401
I may be misunderstanding what you are requesting, however, the measures you have created are correct in what they are calculating. I believe you need to modify your Sales_P1 and Pop_P1 measures to the following:
Sales_P1 = TOTALYTD ( SUM ( 'Sales'[Conso] ) , 'Date'[Date] )
Pop_P1 = TOTALYTD (SUM ( 'Population'[Pop] ) , 'Date'[Date] )
Give the above a go and hopefully that resolves it 🙂
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Hi,@Thomas94401
Please confirm whether this output is correct.
Cumulative_Amount_per_person =
CALCULATE (
SUM ( 'Table'[Amount_per_person] ),
FILTER ( 'Table', 'Table'[Month] <= EARLIER ( 'Table'[Month] ) )
)
Best Regards,
Community Support Team _Charlottez
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Thomas94401
I may be misunderstanding what you are requesting, however, the measures you have created are correct in what they are calculating. I believe you need to modify your Sales_P1 and Pop_P1 measures to the following:
Sales_P1 = TOTALYTD ( SUM ( 'Sales'[Conso] ) , 'Date'[Date] )
Pop_P1 = TOTALYTD (SUM ( 'Population'[Pop] ) , 'Date'[Date] )
Give the above a go and hopefully that resolves it 🙂
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
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 |
---|---|
115 | |
100 | |
89 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |