Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone.
Beforehand, sorry for my bad english.
I have a table like this ('Table1'):
CODE | STATE |
1015 | A |
1016 | A |
1017 | B |
1015 | B |
1016 | B |
1017 | B |
1015 | C |
1015 | A |
1017 | B |
I want a solution as optimal as possible. (I'd rather calculate with a Power Query function, not DAX).
I want a function (or formula, whatever) that helps me to count every different state for each row with the same code.
My result should be this:
CODE | STATE | RESULT |
1015 | A | 3 |
1016 | A | 2 |
1017 | B | 1 |
1015 | B | 3 |
1016 | B | 2 |
1017 | B | 1 |
1015 | C | 3 |
1015 | A | 3 |
1017 | B | 1 |
I explain the result: For code 1015 is 3 because there are 3 unique values for 1015 (A,B,C). For code 1016 is 2 there are 2 unique values (A,B). For code 1017 is 1 because there are 1 unque value for 1017 (B).
Solved! Go to Solution.
Another thing you may want to try then is instead of appending the two data tables, merge them side by side.
So intead of your original table, you end up with something like this:
CODE | PREV_STATE | CUR_STATE | CHANGED |
1015 | A | A | TRUE |
1016 | A | B | FALSE |
1017 | B | B | TRUE |
If whatever index you're using for each row stays the same between days, this may be a better way to store your data. Be sure to check my previous reply for DAX code to solve your original problem
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |