Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Compare positive and negative numbers in rows.

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

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

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"
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

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 ?yuliana.png

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

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors