Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
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.
Solved! Go to Solution.
Hi @Anonymous ,
1. Add a custom column:
2. Filter on TRUE.
3. Remove the custom column.
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.
Hi @Anonymous ,
1. Add a custom column:
2. Filter on TRUE.
3. Remove the custom column.
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |