Forum Discussion
Power Bi, Dax query
- 3 years ago
No need for DAX.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIE4sSkZKVYHQjfCYgrKqvgfGcgzs3LB/ONoOoLCovgfCck/cZQ+eTkRDDfBGZ+cQqcD1KfllIM5ptC5QvLU+F8kH1p6RlKsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Id = _t, Task = _t, Name = _t]), #"Added Custom" = Table.AddColumn(Source, "Output", each if [Task] = "A" then if Table.RowCount(Table.SelectRows(Source,(k)=> k[Id]=[Id] and k[Task]="B"))=0 then [Name] else null else [Name]) in #"Added Custom"How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".
No need for DAX.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIE4sSkZKVYHQjfCYgrKqvgfGcgzs3LB/ONoOoLCovgfCck/cZQ+eTkRDDfBGZ+cQqcD1KfllIM5ptC5QvLU+F8kH1p6RlKsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Id = _t, Task = _t, Name = _t]),
#"Added Custom" = Table.AddColumn(Source, "Output", each if [Task] = "A" then if Table.RowCount(Table.SelectRows(Source,(k)=> k[Id]=[Id] and k[Task]="B"))=0 then [Name] else null
else [Name])
in
#"Added Custom"
How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done".
Hi @Ibendlin,
The below code is working correclty as needed but it taking lot of time to refresh like the refresh count goes 3 times of the original data. Any solution for that. Without adding that custom column it will refresh in seconds but after adding this it taking arround 10 minutes of time.
#"Added Custom" = Table.AddColumn(#"Reordered Columns", "Custom", each if [task] = "A" then if Table.RowCount(Table.SelectRows(#"Reordered Columns",(k)=> k[id]=[id] and k[task]="B"))=0 then [name] else null
else [name])
in
#"Added Custom"
- lbendlin3 years agoSuper User
Read about Table.Buffer and use it in an intermediate step.