Forum Discussion
Anonymous
6 years agoNot applicable
Differrance betwee two values in rows
Hi, I got the follwing issue. in a table i got a number of maximum times allowed. In a other table i got the times given. Now i want to see all rows where the given times are greater than t...
- 6 years ago
Hello Anonymous
the solution I proposed is Power Query. That what you are stating is DAX.
If the DAX solution is okay, go for it.
However, if you are copying my code into the advanced editor, it should not spin. Is a straightforward code. This is the result of combining the example data in my code
Jimmy
AnkitBI
6 years agoSolution Sage
Hi Anonymous
Are both Columns for Maximum Times allowed and Times given in same table or different tables?
Thanks
Ankit Jain
AnkitBI
6 years agoSolution Sage
Hi Anonymous
If in Same table, then use below.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8i8tccovzUtR0lGK8vQDkobGECJWh36S+OTMCBlqphQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ColA = _t, ColB = _t, TimesAllowed = _t, MaxTimesAllowed = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ColA", type text}, {"ColB", type text}, {"TimesAllowed", Int64.Type}, {"MaxTimesAllowed", Int64.Type}}),
IsTimesAllowedGreater = Table.AddColumn(#"Changed Type","IsGreater",each if ([TimesAllowed] > [MaxTimesAllowed]) then "Y" else "N",type text),
#"Filtered Rows" = Table.SelectRows(IsTimesAllowedGreater, each ([IsGreater] = "Y"))
in
#"Filtered Rows"
Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.