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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Calculation from Spotfire to Power BI

Hi All,

I have calculation in the spotfire mentioning below.I have two columns Start date and End Date and need to filter based on the condition.

Transformation - Filtered Rows

[Start Date]>= [End Date]

I need to convert this calculation in Power BI Query Editor.

Please help.

 

Thanks.

 

 

 

 

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

1. Add a custom column:

Vlianlmsft_0-1646017441083.png

2. Filter on TRUE.

3. Remove the custom column.

Vlianlmsft_1-1646017487405.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TYxLDoAwCAXvwrokBUXrWUgX9Xf/IwgaIrvJm8lThQEFuDIhoQQyNuhFYY9hwjVwsczdEYPgFjhb5u78BrZPkmC2zuX1D1RT+Mo7yZYkQ+8P", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Task = _t, Start = _t, End = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Task", type text}, {"Start", type date}, {"End", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each [Start]>=[End]),
    #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Custom] = true)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Custom"})
in
    #"Removed Columns"


Best Regards,
Liang
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-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

1. Add a custom column:

Vlianlmsft_0-1646017441083.png

2. Filter on TRUE.

3. Remove the custom column.

Vlianlmsft_1-1646017487405.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TYxLDoAwCAXvwrokBUXrWUgX9Xf/IwgaIrvJm8lThQEFuDIhoQQyNuhFYY9hwjVwsczdEYPgFjhb5u78BrZPkmC2zuX1D1RT+Mo7yZYkQ+8P", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Task = _t, Start = _t, End = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Task", type text}, {"Start", type date}, {"End", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each [Start]>=[End]),
    #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Custom] = true)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Custom"})
in
    #"Removed Columns"


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.