Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I need to sum quanities differently depending on my column values. The working example is much more complex with info I cannot share so I have drafted up a basic example using the Table below.
In the measure, I simply Sum up the quantities, but where the type is a Donkey I add the quanitites from Cow's (VAR _A).
Table
Type Quantity
Donkey | 5 |
Donkey | 5 |
Duck | 3 |
Duck | 5 |
Dog | 4 |
Dog | 5 |
Cow | 3 |
Cow | 5 |
Everything works how I want it to except the total is incorrect as I am using selected value (I underdstand why). Can anyone please assist? I cannot use a calculated column in the real example.
Solved! Go to Solution.
Hi,
so, leave your first calculation like this
Hi,
I dont know if it is gonna fit your real example,
but here it is
Hi Olgad,
Thanks again for the above. It solves the issue listed but I didnt distill the complexity of my issue into the example very well.
I'm hoping this might be more in line with my issue. If we use the same measure but using your method of HASONEVALUE there are more cases which need to be involved.
Because I need to Filter ALL on some tables I cannot then make it sum properly. I've been trying to create seperate measures and Sum them just in a total but the SelectedValue always follows.
I hope I'm missing something obvious. Let me know if you get the chance?
Thanks
Hi,
so, leave your first calculation like this
Much appreciated thanks. I've used Summarize to create tables in my data models but not wrapped inside SUMX like that so a very useful piece of learning, it worked in the large working model.
I tried to add the Example2 code as a RETURN - referencing Example as a variable (so it was all in the same measure) but the total was in the billions? I was looking at a neat way to put it all in one measusure but obviously not essential.
Thanks again
lately i had to correct totals a lot, just doest work out within a variable (that was my intention too to just have it in one place), alas, you have to create a second measure.
Hi Olgad,
Hope you're well.
I wondered if you knew what might be going wrong in a new scenario I have. Have you ever had only the grand totals wrong? I'm using HASONEVALUE to flick between different summarizes and everything is great accept the grand total (see pic). I'm aware this is limited info as I cannot share anything but thought it might be something you're used to seeing. I'm summarizing here against the periods/dates on the left...The grand total in the corner is off by circa £3m...
Thanks for any tips
I've had to on some running totals as that's how it was done on some working examples online so I think it is the only way in some scenarios. Cheers
Thanks so much Olgad, just away from my work at the moment I'll give it a whirl on Monday. Cheers
User | Count |
---|---|
50 | |
24 | |
18 | |
17 | |
14 |
User | Count |
---|---|
91 | |
84 | |
39 | |
25 | |
21 |