Forum Discussion
Ignoring row context with DAX
Hello everyone,
I have the next two tables that are taken from my power BI report
The first table contains :
- Column 1 : « Comptenum & comptelib » is taken from my table of facts called « FEC » : its the account number & its name
- Column 2 : « Montant » represents the amounts ; is also taken from my table of facts « FEC » but I renamed it for this specific table. The real name in the table is « Solde »
- Column 3 : is a measure that counts the number of amounts per account number
I put a filter on column 3 that basically says : only show me the accounts that have duplicated amounts (ie count of « #count soldes » is >= 2). Also, there is filter applied on the table the takes only accounts that start with « 6 » from a column called FEC[Classe].
The second table is the same as the first one but contains an additional column called « Date & Jnl & ref & Lib » that I simply took from my table of facts « FEC ».
My objectif is to do the same calculation as the « Count soldes » measure in my first table but I want it to show the same result as the first table.
In other words I want it to ignore the context that is coming from the additional column that I added « date & jnl & ref & lib ».
My objectif is to create a better user experience by allowing him to click on one row from the first table and see the details on the second table and keep both coherent for the count measures .
I already tried this DAX formula
#Count soldes détails_A1 =
CALCULATE(
COUNT(FEC[SOLDE]),
FEC[Classe] = "6",
ALLEXCEPT(
FEC,
FEC[Comptenum & comtelib],
FEC[SOLDE]
)
But it is showing me the total number of amounts in each account.
I tried it also with the ALL function using this formula :
#Count soldes détails_A1 =
CALCULATE(
COUNT(FEC[SOLDE]),
FEC[Classe] = "6",
ALL(FEC),
VALUES(FEC[Comptenum & comtelib]),
VALUES(FEC[SOLDE])
)
But it shows a different result also.
Thank you in advance for your help.
Hi CheikhnaML ,
It is not clear whether you can provide test data (delete sensitive information) and expected results. I will answer for you as soon as possible.
Looking forward to your reply.
Best Regards,
Henry
2 Replies
- v-henryk-mstfCommunity Support
Hi CheikhnaML ,
It is not clear whether you can provide test data (delete sensitive information) and expected results. I will answer for you as soon as possible.
Looking forward to your reply.
Best Regards,
Henry- CheikhnaMLFrequent Visitor
Hello v-henryk-mstf ,
Thank you for your answer. I appreciate your help.
I finally was able to find the solution myself. I used the ALLEXCEPT DAX formula to make it worK.
I am user of excel and I am new to all this Power Bi and DAX world.
Thank you and have a good day.