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 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
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |