Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hello,
I am not sure,How to compare rows in power bi? Query Editor or Dax ?
Loigc:
Step 1:Need to find Negative Count, Negative Avg and Negative Curr
No | Flag | Count | Avg | Curr |
111 | N | 1 | 200 | 600 |
Step 2:Need to find Positive Count, Positive Avg and Positive Curr
No | Flag | Count | Avg | Curr |
111.1 | Y | -1 | -200 | -600 |
Expection:Count positive and negative number should be same, Avg positive and negative number should be same,Curr positive and negative number should be same then in a new column mark it as A and if condtion does not match then mark it as B (In other word when Avg and Curr are unique then mark it as B).
Dataset
Raw Data | |||||
No | Flag | Count | Avg | Curr | |
111 | N | 1 | 200 | 600 | |
222 | N | 1 | 300 | 700 | |
333 | N | 1 | 400 | 800 | |
111.1 | Y | -1 | -200 | -600 | |
555.1 | N | 1 | 500 | 900 | |
Result | |||||
No | Flag | Count | Avg | Curr | Check |
111 | N | 1 | 200 | 600 | A |
222 | N | 1 | 300 | 700 | B |
333 | N | 1 | 400 | 800 | B |
111.1 | Y | -1 | -200 | -600 | A |
555.1 | N | 1 | 500 | 900 | B |
Hi @Anonymous,
Please new a calculated table in raw data table.
Check = IF ( LOOKUPVALUE ( 'Raw Data'[No], 'Raw Data'[Count], 'Raw Data'[Count] * -1, 'Raw Data'[Avg], 'Raw Data'[Avg] * -1, 'Raw Data'[Curr], 'Raw Data'[Curr] * -1 ) <> BLANK (), "A", "B" )
Best regards,
Yuliana Gu
Hi Yuliana,
Thank you so much for your help.
When I have used below forumula it gave me below error.Due to duplicate dataset i get an error this is what i figure it out but i am not sure how to fix below error?
Is there any suggestion ?
Hi @Anonymous,
Please refer to my reply in an other post.
A table of multiple values was supplied where a single value was expected
Regards,
Yuliana Gu