Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I've been through this forum and found some posts that broach the subject but do not quite match my requirements.
So, my problem is simple to explain. I need SUMX to actually sum the values in the column.
The picke resides in the following: the measure without SUMX computes to 0 (as it should). On the other hand, the measure with SUMX declaring VARS computes to a very large number because there are implicit filters in the rows that are not being considered when computing the total. And the measure with SUMX not declaring VARS does not compute correctly row wise because the row context limits inherently its scope.
Let me give an example:
The measure in question is the Monetized Qt Correction Var and it is the product of price and the difference of quantities. As the Qt correction only redistributes the total quantity by each line, the total quantities are exactly the same. I need my measure to sum up to -34.698 (the points are the thousands separators).
Let me paste the 3 measures above and the model (very basic):
How should I go about this?
Thanks!
Solved! Go to Solution.
Hi @Yossarian , Yes, sorry I didn't spot that one. Have you tried summarize. Sorry now I'm only firing bits out because I don't see your underlying model.
Sumx(Summarize(Buyer, Product, "Measure",[Measure]),[Measure])
Hi @Yossarian ,
Try this and see if it works.
SUMX(FIRSTNONBLANK('TBL BUYERPROD'[BUYER],1),[Monetised Qt Correction Var (Sumx Meas vers)])
Hope this helps,
Did I help you today? Please accept my solution and hit the Kudos button.
Hi @davehus ,
It seems it is not the solution:
Anyway, why restricting the table (on SUMX) to only the first buyer (if I am reading correctly)?
Thanks!
Hi @Yossarian , Yes, sorry I didn't spot that one. Have you tried summarize. Sorry now I'm only firing bits out because I don't see your underlying model.
Sumx(Summarize(Buyer, Product, "Measure",[Measure]),[Measure])
Hi @davehus ,
Just a quick follow up question if you don't mind.
For me, conceptually, the correct approach would be to SUM the column of the summarized table. Why does SUMX on your solution use the calculated values of the inner measure? Shouldn't it just iterate on the summarized table and calculate the measure again - leading to the same results as before?
Thanks again!
Hi @davehus ,
Yes, I have tried summarize but with addcolumns instead. I can't really tell how many variations I have tried to no avail.
However, your proposal works for the total! 👌 It works with 2 of the measures (the SUMX VAR version and the no SUMX version). The underlying model is the one I posted, there isn't really anything else (the buyerprod table is used to slice data basically and is one-to-many to sales table).
If it is not possible to consider a measure displaying correctly both rows and total, I will proceed with the "IF workaround" and mark your reply as the solution.
Lifesaviour post, really!
Thanks.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
90 | |
87 | |
84 | |
68 | |
49 |
User | Count |
---|---|
131 | |
111 | |
96 | |
71 | |
67 |