Forum Discussion

Narender's avatar
Narender
Resolver I
8 years ago
Solved

Add a null condition in DAX

Hi all,

 

I have to add a null condition in DAX.

 

My condition is like:

 

Measure =

CALCULATE(sum(TAX_TRANSACTION[TAX_SUB_TRANS.AMOUNT]),

FILTER(TAX_TRANSACTION,TAX_TRANSACTION[TAX_SUB_TRANS.REVERSE_FLAG]="N" && (TAX_TRANSACTION[TAX_SUB_TRANS.CHARGE_TYPE_NO]=2 ||TAX_TRANSACTION[TAX_SUB_TRANS.CHARGE_TYPE_NO]=13 ||TAX_TRANSACTION[TAX_SUB_TRANS.CHARGE_TYPE_NO]=15))) 

 

I need to add TAX_SUB_TRANS.REVERSE_FLAG]=null or "N"

 

In above expression I write only TAX_SUB_TRANS.REVERSE_FLAG] "N"  because Null is not working.

 

Plaese tell mw how  can I add Reverse_flag = null?

 

 

Thanks,

 

Narender

 

 

 

7 Replies

  • Hi Narender,

     

          There is  ISBLANK function in Power BI, use that, If any issue let me know.

     

    msdn Example:- //Sales to Previous Year Ratio

     

    =IF( ISBLANK('CalculatedMeasures'[PreviousYearTotalSales]) , BLANK() , ( 'CalculatedMeasures'[Total Sales]-'CalculatedMeasures'[PreviousYearTotalSales] ) /'CalculatedMeasures'[PreviousYearTotalSales])

     

     

    Thanks

    • Narender's avatar
      Narender
      Resolver I

      Hello Lokesh,

       

      I  have to add simple condition not the if condition like

      Sum of sale where regime_code = N or Null

       

      Is there any way to add this condition in DAX.

      I am facing problem in Null .If condition will not resovle my issue.

       

       

      Thanks,

       

      Narender