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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Madhans
Frequent Visitor

New Column DAX

Actually what I need is zero in my LOGIC column whenever I meet the below requirements(IN DAX),

But if you see in the USD AMOUNT column the 175 data should not be zero in the LOGIC column because both 175 are positive.Screenshot_20230209_111112.png

Kindly help me out with the modifications that I have to make in the DAX.Screenshot_20230209_104519.png

4 REPLIES 4
Madhans
Frequent Visitor

Hi Tamerj,

Thanks for the effort!
but what i am getting is as  

My month filter is Aug only, I am getting 0  in a Logic column for all three rows which should not be the case . I should get a zero for the negative sign 14790 and either of any positive sign 14790 value in the USD Amount column.   For Example :  USD Amount       Logic  -14790                    0  14790                     0  14790My month filter is Aug only, I am getting 0 in a Logic column for all three rows which should not be the case . I should get a zero for the negative sign 14790 and either of any positive sign 14790 value in the USD Amount column. For Example : USD Amount Logic -14790 0 14790 0 14790


My month filter is Aug only, I am getting 0 in a Logic column for all three rows which should not be the case . I should get a zero for the negative sign 14790 and either of any positive sign 14790 value in the USD Amount column.

For Example :

USD Amount      Logic

-14790                  0
14790                   0
14790

@Madhans 
There must be a condition that defines which one of them shall be assigned a 0

My requirement is if the Month, Po No, and Account code is the same then we have to check the USD amount column if the value is like for exam 475 and - 475 then there should be zero otherwise it should be blank, there are certain Month, Po no, and Account code that is having only positive values or negative values so those should be blank.

It is a kind of nullifying the usd amount based on Month,Po No,Account code.

tamerj1
Super User
Super User

Hi @Madhans 

Please try

 

Logic =
VAR PO = Table1[PO No]
VAR USD = Table1[USD Amount]
VAR T =
    CALCULATETABLE (
        Table1,
        ALLEXCEPT ( Table1, Table1[Month], Table1[PO No], Table1[Account Code ] )
    )
VAR A1 =
    COUNTROWS ( FILTER ( T, Table1[USD Amount] = USD ) )
VAR A2 =
    COUNTROWS ( FILTER ( T, ABS ( Table1[USD Amount] ) = ABS ( USD ) ) )
RETURN
    IF ( PO <> BLANK () && A1 <> A2 && A2 >= 2, 0 )

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.