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 need to add another filter argument in my dax formular.
Right now, I have the following:
Duplicate Cust. Ref = CALCULATE(
COUNT(
'ABC'[DEF]
),
Filter(
'ABC',
'ABC'[DEF]=EARLIER('ABC'[DEF)
)
)
Now I need to include also the column "ABC[XYZ]" as a second argument to filter. So I only need the count when both arguments are true.
Any help how I can achieve this?
Thanks
Alexander
Solved! Go to Solution.
Hi @oldrunner ,
The EARLIER function is usually used in calculated columns, please use the MAX or SELECTEDVALUE function in the measure, like this:
Duplicate Cust. Ref =
CALCULATE (
COUNT ( 'ABC'[DEF] ),
Filter ( 'ABC', 'ABC'[DEF] = MAX ( 'ABC'[DEF] ) )
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @oldrunner ,
The EARLIER function is usually used in calculated columns, please use the MAX or SELECTEDVALUE function in the measure, like this:
Duplicate Cust. Ref =
CALCULATE (
COUNT ( 'ABC'[DEF] ),
Filter ( 'ABC', 'ABC'[DEF] = MAX ( 'ABC'[DEF] ) )
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I get the message that "earlier" functions cannot be nested. So, unfortunately, this did not work.
Maybe my question was not quite correct. I need to filter on two different columns and it should only count when both (or more) arguments are true. So for example the customer name and the purchase order number (as different customers might have the same purchase order number).
Thanks
Alex
Thanks.
I get the message that earlier functions cannot be nested. Maybe my question was not quite correct. I need to filter on two different columns and it should only count when both (or more) arguments are true. So for example the customer name and the purchase order number (as different customers might have the same purchase order number).
Thanks
Alex
@oldrunner , Check the solution by @darshaningale . If that do not work try
Duplicate Cust. Ref = CALCULATE(
COUNT(
'ABC'[DEF]
),
Filter(
'ABC',
'ABC'[DEF]=EARLIER('ABC'[DEF)
&& ABC[XYZ] = earlier(ABC[XYZ])
)
)
Duplicate Cust. Ref = CALCULATE(
COUNT(
'ABC'[DEF]
),
Filter(
'ABC',
'ABC'[DEF]=EARLIER('ABC'[DEF) && ABC[XYZ] ='something'
)
)
Regards
DI
Did I answer your question? Mark my post as a solution, this will help others!
Kudos are also welcome.
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 |
---|---|
94 | |
90 | |
84 | |
70 | |
49 |
User | Count |
---|---|
143 | |
121 | |
112 | |
58 | |
57 |