March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello
I get a problem with this sum and filter function.
The good result of my sumx is 11,30 for the condition I ask for. I get this number all the time (which is good) for a same client (CIFD here) as you an see underneath . But when the client changes, (MGEN for instance), the number is twice and wrong. I do not understand because my condition does not include any Client Column, It should have no impact on the result. It looks like Sumx function calculate twice at each changement of client. Do not understand.
SUMX(FILTER('Table'; 'Table'[ANNEE] = EARLIER('Table'[ANNEE]) && 'Table'[NUM MOIS]=EARLIER('Table'[NUM MOIS]) && 'Table'[COLLABORATEURId]=EARLIER('Table'[COLLABORATEURId]);'Table'[NB JR HSITE])
Solved! Go to Solution.
I found out the problem.
The syntax of my formula was ok, the table organization (with Index etc..) was ok too.
The problem came from a real line recorded twice that could'nt be seen in the report.
Sorry for all that!
Patrick.
I tried to format your DAX and got and error report
SUMX(
FILTER(
'Table'; 'Table'[ANNEE] = EARLIER('Table'[ANNEE])
&& 'Table'[NUM MOIS]=EARLIER('Table'[NUM MOIS])
&& 'Table'[COLLABORATEURId]=EARLIER('Table'[COLLABORATEURId]);
-----> Missing ) ?
'Table'[NB JR HSITE])
When I do the formatting myself it looks like the closing parens for the FILTER function is missing
Help when you know. Ask when you don't!
A ")" has to be add to my condition because I did an extract from my code. But It is not the problem =>
SUMX(FILTER('Table'; 'Table'[ANNEE] = EARLIER('Table'[ANNEE]) && 'Table'[NUM MOIS]=EARLIER('Table'[NUM MOIS]) && 'Table'[COLLABORATEURId]=EARLIER('Table'[COLLABORATEURId]);'Table'[NB JR HSITE]))
here is a bigger screen firts =>
I don't understand what you are saying about two "differents row contexts".
SUMX(FILTER('Table'; 'Table'[ANNEE] = EARLIER('Table'[ANNEE]) && 'Table'[NUM MOIS]=EARLIER('Table'[NUM MOIS]) && 'Table'[COLLABORATEURId]=EARLIER('Table'[COLLABORATEURId]);'Table'[NB JR HSITE]))
I'm just trying to sum some days (NB JR HSITE) in relation with different criterias. The output is OK for the fist rows of the table and become wrong (twice wrong) for one row of the table.
Just a remark, I'tried to change with a new formula CALCULAT/SUM/ALL/ FILTER and the problem is the same.
My formula adress only one Table "Activites mensuelles" as shown underneath.
Note that I don't understand your word "fact".
The problem comes from a lack of index indeed, Thank you. When I add my new index at beginning of the key fields of my Matrix report the filter works fine. There is no value computed twice. But when I do that my Matrix report is no way because I want to be able to navigate from year, to month number, to customer, to project and to employee from the left panel of the report as you can see underneath. I could manage a new index with all those fields but I will not be able to navigate. What can I do..?
Hello
Please, Can somebody ask to my previous message?
Thanks.
I found out the problem.
The syntax of my formula was ok, the table organization (with Index etc..) was ok too.
The problem came from a real line recorded twice that could'nt be seen in the report.
Sorry for all that!
Patrick.
Hey @PatrickByGecko ,
I'm not able to read through the screenshot you provided, maybe you can provide a pbix file that contains sample data, upload the file to onedrive or dropbox and share the link.
Nevertheless, you have to be aware that the issue you describe can occur when the table, that is returned by the FILTER statement, contains more than one row, check your filter statement.
Regards,
Tom
User | Count |
---|---|
120 | |
77 | |
58 | |
52 | |
46 |
User | Count |
---|---|
171 | |
117 | |
63 | |
57 | |
51 |