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
Can you do somthing with this?
The last collum(H) is what i'm trying to make from the two different tables (FeitLevering and CoderingMaxTrances)
So value maxOmvang minus aVolume
Hi H_Delwel,
Yes, I will try to get the result of your image, but if possible, could you please show me the four table samples instead of showing the data in same visual, I need to know their structure and try to reproduce this in my environment.
Please do mask sensitive data before uploading.
Thanks for your understanding and support.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 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
- Anonymous6 years agoNot applicable
Hi Zoe,
Do you mean like this?
- Jimmy8016 years agoCommunity Champion
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 - Anonymous6 years agoNot applicable
Hi Jimmy,
I'm getting an error on this "EOF" missing.
- 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