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 H_Delwel,
If possible, could you please inform me more detailed information (such as your sample data an your expected output)? Then I will help you more correctly.
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.
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
- dax6 years agoCommunity Support
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 ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 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