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.
Workday Number =
VAR CurrentMonth =
SELECTEDVALUE ( 'Date'[Year Month] )
VAR MonthTable =
FILTER (
ALL ( 'Date' ),
'Date'[Working Days] = "Weekday"
&& 'Date'[Year Month] = CurrentMonth
)
RETURN
IF (
SELECTEDVALUE ( Date[Working Days] ) <> "Weekday",
BLANK (),
RANKX ( MonthTable, CALCULATE ( AVERAGE ( Date[DayOfMonth] ) ),, ASC )
)
Can anyone tell me why is this formula not working on current version of power bi?
Solved! Go to Solution.
@Anonymous
I would venture it is because your RANKX function doesn't have the column reference to rank the values by. Include a column reference after the table reference:
RANKX ( MonthTable, MonthTable[...], CALCULATE ( AVERAGE ( Date[DayOfMonth] ) ),, ASC )
See if that works.
EDIT: you might also need an ALL or ALLSELECTED before the table expression, depending on the context you wish to calculate de Rank by:
RANKX ( ALLSELECTED(MonthTable), MonthTable[...], CALCULATE ( AVERAGE ( Date[DayOfMonth] ) ),, ASC )
Proud to be a Super User!
Paul on Linkedin.
@Anonymous
I would venture it is because your RANKX function doesn't have the column reference to rank the values by. Include a column reference after the table reference:
RANKX ( MonthTable, MonthTable[...], CALCULATE ( AVERAGE ( Date[DayOfMonth] ) ),, ASC )
See if that works.
EDIT: you might also need an ALL or ALLSELECTED before the table expression, depending on the context you wish to calculate de Rank by:
RANKX ( ALLSELECTED(MonthTable), MonthTable[...], CALCULATE ( AVERAGE ( Date[DayOfMonth] ) ),, ASC )
Proud to be a Super User!
Paul on Linkedin.
Hi @Anonymous ,
Please make sure your table names are consistent, otherwise errors will occur. Change table name to either 'Date' or Date.
what error message are you getting?
Proud to be a Super User!
It says the syntax is incorrect but everything looks fine
www.daxformatter.com isn't throwing any errors.
are you creating a calculated measure or calculated column? also have you run this successfully before?
Proud to be a Super User!
I'm creating a calculated column, yaa it was running before but now it's not
Hi,
No idea if it would solve it but you could try adding a ' before and after the table name and to remove the calculate something like below
RETURN
IF(SELECTEDVALUE ( 'Date'[Working Days] ) <> "Weekday",
BLANK (),
RANKX ( MonthTable, AVERAGE ( 'Date'[DayOfMonth] ),, ASC )
)
I don't think it will work,
@Anonymous thats a different error now though which is strange. i see you changed the field names or is that the real names ?
if you go back to the original (although i can't see how this will work but i guess you have to eliminate all possiblities), and just add apostrophes so its named consistenly without does that make a difference?
Workday Number =
VAR CurrentMonth =
SELECTEDVALUE ( 'Date'[Year Month] )
VAR MonthTable =
FILTER (
ALL ( 'Date' ),
'Date'[Working Days] = "Weekday"
&& 'Date'[Year Month] = CurrentMonth
)
RETURN
IF (
SELECTEDVALUE ('Date'[Working Days] ) <> "Weekday",
BLANK (),
RANKX ( MonthTable, CALCULATE ( AVERAGE ( 'Date'[DayOfMonth] ) ),, ASC )
)
Proud to be a Super User!
eish 🙂
i can't see the fulll error, and you say the only difference is you have updated your power bi to the latest thats the only change? strange that it doesn't actually underline the issue.
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 |
---|---|
145 | |
87 | |
66 | |
51 | |
45 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |