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.
Hello,
I am trying to create a new column "Result".
The Result column is created based on this logic, compare value on B3 with value on B2, if it is the same then compare value on A3 with value on A2 if it is the same then the Result in C3 = 1.
Next, compare value on B4 with value on B3, if it is the same then compare value on A4 with value on A3 if it is different then the Result in C4 = 2.
Finally, compare value on B5 with value on B4, if it is different then the Result in C5 = 3.
Thank you in advance.
Solved! Go to Solution.
hi, @Anonymous
You could try this way:
Step1:
Add an index column in edit queries or use Rankx Function
Step2:
Use this formula to add a calculate column
Result = IF ( 'Table'[Index] = 1, "s", IF ( CALCULATE ( MAX ( 'Table'[Type] ), FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 ) ) = 'Table'[Type], IF ( CALCULATE ( MAX ( 'Table'[Size] ), FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 ) ) = 'Table'[Size], "1", "2" ), "3" ) )
Result:
here is a simple pbix file, please try it.
Best Regards,
Lin
hi, @Anonymous
You could try this way:
Step1:
Add an index column in edit queries or use Rankx Function
Step2:
Use this formula to add a calculate column
Result = IF ( 'Table'[Index] = 1, "s", IF ( CALCULATE ( MAX ( 'Table'[Type] ), FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 ) ) = 'Table'[Type], IF ( CALCULATE ( MAX ( 'Table'[Size] ), FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 ) ) = 'Table'[Size], "1", "2" ), "3" ) )
Result:
here is a simple pbix file, please try it.
Best Regards,
Lin
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 |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |