Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
moba
New Member

Token RightParent expected error

hi when i try to use create this function i get Token RightParent expected error in the “Filtered Rows” line and the issue is with the numbers. Anny idea why ?

Thank you
(StartDate as date, EndDate as date) as number =>
let
Source =
(if StartDate <= EndDate then
List.Dates(StartDate,
Duration.Days(EndDate-StartDate)+1,
Duration.From(1))
else
List.Dates(EndDate,
Duration.Days(StartDate-EndDate)+1,
Duration.From(1))
),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Inserted Day of Week" = Table.AddColumn(#"Converted to Table", "Day of Week", each Date.DayOfWeek([Column1], Day.Monday), Int64.Type),
#"Filtered Rows" = Table.SelectRows(#"Inserted Day of Week", each ([Day of Week] 5 and [Day of Week] 6)),
Custom1 = if StartDate <= EndDate then Table.RowCount(#"Filtered Rows") else Table.RowCount(#"Filtered Rows") * (-1)
in
Custom1

 

This e-mail is confidential and it is intended only for the addressees. Any review, dissemination, distribution, or copying of this message by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message from your system. The sender does not accept liability for any errors or omissions in the contents of this message which may arise as a result of the e-mail transmission.

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @moba 

Change the code below, it would work.

#"Filtered Rows" = Table.SelectRows(#"Inserted Day of Week", each ([Day of Week]= 5 and [Day of Week] =6))

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @moba 

Change the code below, it would work.

#"Filtered Rows" = Table.SelectRows(#"Inserted Day of Week", each ([Day of Week]= 5 and [Day of Week] =6))

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.