Forum Discussion
Differrance betwee two values in rows
- 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
Hi Anonymous
Are both Columns for Maximum Times allowed and Times given in same table or different tables?
Thanks
Ankit Jain
- AnkitBI6 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. - Anonymous6 years agoNot applicable
They are both in different tables
- AnkitBI6 years agoSolution Sage
Hi Anonymous Can you share sample data from both table in that case.
- Anonymous6 years agoNot applicable
Not sure how,
There is a table called "Codering max trances" with two collums "Productcode" and "max omvang"
This got a relation with a table called "DimVoorziening" on productcode.
The table "DimVoorziening"has a relation with a table called "FeitNVTZ" on a unique codenumber, different from the productcode.
Finaly there is a relation from "FeitNVTZ"to a table called "FeitLevering"
This last table contains the values of the the given form collum "aVolume"
So what i need is the difference between
"Codering max trances"[max omvang] - "FeitLevering"[aVolume]
Then, when the value is 0 or less than zero i want to filter on those values so someone can get in contact with the company's which has more trances than the max volume.