Row Totals Incorrect

Good day

Please can you assist me with this issue i cannot explain, i am trying to calculate % of calls per segment which i get right. when this is put into a matrix the row total dont sum correctly.

DAX
image

Matrix

any idea how i can resolve this?

1 Like

Hi @neilonbooysen it would be a massive help if you could post a PBIX file. You can always provide a PBIX with masked data.

DJ

Incorrect Row Total.pbix (28.2 KB)

@DavieJoe apologies, should of included this earlier

I’m in the office today so I can’t look at this until this evening, the firewall stops me downloading your file to look at it.

If someone else wants to jump in and help, please, be my guest.

DJ

Hi @neilonbooysen

The easiest way to troubleshoot this is to throw your numerators and denominators into the same visual context.

See table to the right:

From there, you can determine where the formula is not showing expected results.
So in your instance, it will just be the ALL() that probably needs changing depending on your requirements. Example one of these…

Rating Calls = 
CALCULATE([calls],ALL(jamie[Rating] ))
CALCULATE([calls], ALL())
CALCULATE([calls], ALL(jamie[Market]))

Let me know how you go

Cheers
M

2 Likes

Incorrect Row Total.pbix (33.1 KB)

Hi Michelle, so i ended up adding more data to the report to test it, i basically need it to work with market filter when selecting market. the market is total 100% and if not selected grand total should reach 100%

Thanks for your suggestion ealier, it worked for single market but ran into the next market

@neilonbooysen
% within Market? like so…

Rating Calls = CALCULATE([calls],ALLEXCEPT(jamie, jamie[Market]))

Nope this didnt work, below is an excel example of what i need

@neilonbooysen - please could you resend your pbix or screenshot the value that is not presenting as expected?

Incorrect Row Total.pbix (33.1 KB)
here you go Michelle

Right, I think I misread the requirement as being % within the market only.

But we’re after % of All within selections?

Rating Calls = CALCULATE([calls],ALLSELECTED(jamie))

Hi Michelle

this has worked for the masked pbix i have shared, when i tried to implement this in my mode i dont get the correct column or row totals,

Difference in my model, 4 different tables used as apposed to the single table “jamie”

Market (territory table)
Rating (rating table)
Category (product table)

the measure “Rating Calls = CALCULATE([calls],ALLSELECTED(jamie))” which references all selected is placed in a single table in the masked data. any other ideas?

Hi @neilonbooysen

I think you should be able to get the same result if you don’t include a table:-

Rating Calls = CALCULATE([calls], ALLSELECTED())

*assuming you want all in scope, not just the 3 tables mentioned in a larger complex model

However, in other instances, and depending on your requirements, you may find that the output displayed might not be desirable (e.g. say you did a matrix on just Rating Calls). So you would probably need to wrap it into something that suits, e.g.

Rating Calls = 
IF(NOT ISBLANK([calls]), 
    CALCULATE([calls], ALLSELECTED())
)

Apologies if I’ve oversimplified my assumptions again, I may need the full file next round :sweat_smile:

Cheers
M

Hi Michelle

just realized what is causing the problem in my model, the category is created with Groups (BINS) and when this is used the division doesn’t work correctly in POWERBI. using another field in columns such as month works fine. Tried your fix but still didnt win. Extracting all info and build in excel works and even with the stand alone report it works. (PBIX attached)
Incorrect Row Total.pbix (33.1 KB)

in the real model, we are using 3 tables for this exercise

Product (category)
calls (calls)
territory (market)
Rating (rating)

Relationship

Rating to calls (rating field)

Incorrect Row Total2.pbix (720.8 KB)

@MichelleLe here is a new file with model, this is exactly what im seeing

hi @MichelleLe any luck?

@DavieJoe any ideas from your side?

I’ve found the thread a bit confusing tbh, not 100% sure what the problem is.

Incorrect Row Total2.pbix (720.8 KB)

Hi David, issue here is that the Rows total correctly, colums and rows need to add to 100% but in this case i cannot get it workin?

image

1 Like

I posted the wrong YouTube link before, please see below updated link

2 Likes