Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have created the below Dax, which is throwing some errors, not sure what I am doing incorrectly
Solved! Go to Solution.
Hi @vjnvinod ,
You canAccording to your formula, for MAX ( 'Current HC'[Weeknumber] ), how exactly do you want to achieve the filtering condition.
One is to group the Weeknumber fields and find the total value corresponding to each group; the other case is to find the total value corresponding to the maximum Weeknumber.
M1 =
VAR max_ =
MAX ( 'Current HC'[Weeknumber] )
RETURN
IF (
SELECTEDVALUE ( 'Current HC'[column] ) = TRUE (),
CALCULATE (
COUNTA ( 'Current HC'[GPN] ),
FILTER ( ALL ( 'Current HC' ), 'Current HC'[Weeknumber] = max_ )
)
)
M2 =
IF (
SELECTEDVALUE ( 'Current HC'[column] ) = TRUE (),
CALCULATE (
COUNTA ( 'Current HC'[GPN] ),
FILTER (
ALL ( 'Current HC' ),
'Current HC'[Weeknumber] = MAX ( 'Current HC'[Weeknumber] )
)
)
)
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @vjnvinod ,
You canAccording to your formula, for MAX ( 'Current HC'[Weeknumber] ), how exactly do you want to achieve the filtering condition.
One is to group the Weeknumber fields and find the total value corresponding to each group; the other case is to find the total value corresponding to the maximum Weeknumber.
M1 =
VAR max_ =
MAX ( 'Current HC'[Weeknumber] )
RETURN
IF (
SELECTEDVALUE ( 'Current HC'[column] ) = TRUE (),
CALCULATE (
COUNTA ( 'Current HC'[GPN] ),
FILTER ( ALL ( 'Current HC' ), 'Current HC'[Weeknumber] = max_ )
)
)
M2 =
IF (
SELECTEDVALUE ( 'Current HC'[column] ) = TRUE (),
CALCULATE (
COUNTA ( 'Current HC'[GPN] ),
FILTER (
ALL ( 'Current HC' ),
'Current HC'[Weeknumber] = MAX ( 'Current HC'[Weeknumber] )
)
)
)
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @vjnvinod ,
Please try this:-
Current HCount =
IF (
SELECTEDVALUE ( WkTbl[Column] ) = TRUE (),
CALCULATE (
COUNTA ( 'Current HC'[GPN] ),
FILTER (
'Current HC',
'Current HC'[Weeknumber] = MAX ( 'Current HC'[Weeknumber] )
)
)
)
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Filter(table name,SELECTEDVALUE ( WkTbl[Column] ) = TRUE ())
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
75 | |
64 | |
52 | |
47 |
User | Count |
---|---|
218 | |
88 | |
73 | |
64 | |
60 |