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
hello Anonymous
I think there are some misunderstandings. Tried to figure out a solution for you. Please check if the concept of this codes works for you.
let
TableA = #table
(
{"Object","Max Allowed"},
{
{"A","15"}, {"B","10"}, {"C","10"}, {"D","5"}
}
),
ChangedTypeA = Table.TransformColumnTypes(TableA,{{"Max Allowed", Int64.Type}}),
TableB = #table
(
{"Object","Times"},
{
{"A","1"}, {"B","1"}, {"C","1"}, {"D","1"}, {"A","1"}, {"B","1"}, {"C","1"}, {"D","1"}, {"A","1"}, {"B","1"}, {"C","1"}, {"D","1"}, {"A","1"}, {"B","1"},
{"C","1"}, {"D","1"}, {"A","2"}, {"B","3"}, {"C","4"}, {"D","5"}, {"A","6"}, {"A","7"}, {"A","8"}, {"B","9"}, {"B","10"}, {"D","11"}, {"D","12"}, {"D","13"},
{"D","14"}
}
),
ChangedTypeB = Table.TransformColumnTypes(TableB,{{"Times", Int64.Type}}),
JoinTables = Table.NestedJoin
(
ChangedTypeA,
"Object",
ChangedTypeB,
"Object",
"Times"
),
CountRowTimes = Table.AggregateTableColumn(JoinTables, "Times", {{"Times", List.Count, "Count of Times"}}),
AddCheck = Table.AddColumn(CountRowTimes, "Check", each if [Count of Times]>[Max Allowed] then "check" else "not check")
in
AddCheckCopy paste this code to the advanced editor to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hi Jimmy,
I'm getting an error on this "EOF" missing.
- Jimmy8016 years agoCommunity Champion
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
- Jimmy8016 years agoCommunity Champion
Hello Anonymous
copy the data into the advanced editor. You don't have appended any screenshot, but I suppose you have copied into the formula bar
Jimmy
- Anonymous6 years agoNot applicable
Hi Jimmy,
I'd copied it in the avanced editor.
I got another solution where they say:
Difference = (COUNTA('Codering max trances' [Max omvang standaard eenheid ZIN]) - COUNTA('FeitLevering'[aVolume])
This looks like a simple solution, However for some reason there is no result. (The wheel keeps spinning)
- Anonymous6 years agoNot applicable
Yes its work now 🙂
I'd tried it in a current table, now i just made a new query 🙂
Thanx a lot