Forum Discussion
Vishnu812
3 years agoFrequent Visitor
Power Bi, Dax query
case 1: Here compare the rows of id if it is same then check its corresponding values in task column (consider only A and B ignore any other values). For example if id 1 has both A and B in ...
- 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".
lbendlin
3 years agoSuper User
Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
Vishnu812
3 years agoFrequent Visitor
Hello,
As u can see in above snap, the above solution working when I create new query. But I want to add it to the existing table, by doing that it showing error as above pls correct me if any mistake in above query.