Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
78 | |
54 | |
39 | |
35 |
User | Count |
---|---|
102 | |
84 | |
48 | |
48 | |
48 |