Forum Discussion

timward10's avatar
timward10
Icon for Helper II rankHelper II
1 year ago
Solved

Formula against a specific cell

Hi, 

 

I have a formula I want to add to a report in PBI, however I have to refer to the previous months cell in excel and move along. What is a similar formula to this in PBI? 

 

=IF(AND($I3="Optilite Special Protein Analyser",AO3<>"",$AL3<>AP$2),"",IF(AND($I3="Optilite Special Protein Analyser",$AL3=AP$2),$AN3,IF($AM3<AP$2,"",IF(AO3<>"",AO3,IF($AK3=AP$2,$AN3,"")))))

 

Thanks!

  • timward10 , Go to modelling tab and select Calculated column and paste this code there or share sample data with me

  • timward10's avatar
    timward10
    1 year ago

    Hi bhanu_gautam, unable to upload sample data, so shared the table below. The formula doesn't work when adding it into the modelling tab. 

     

    Thanks

     

    Product NameRevenue Start DateItem 1 Revenue DateContract End DateSplitJan-25Feb -25Mar-25April-25May-25
    Item 101 January 202501 April 202501 September 202511    
    Item 201 March 202501 August 202501 December 2025105105    
    Item 301 June 202501 September 202501 January 202644    

5 Replies

  • timward10 , Try using DAX and create a calculated column

    DAX
    NewColumn =
    IF (
    AND (
    Table[I] = "Optilite Special Protein Analyser",
    Table[AO] <> BLANK(),
    Table[AL] <> Table[AP]
    ),
    BLANK(),
    IF (
    AND (
    Table[I] = "Optilite Special Protein Analyser",
    Table[AL] = Table[AP]
    ),
    Table[AN],
    IF (
    Table[AM] < Table[AP],
    BLANK(),
    IF (
    Table[AO] <> BLANK(),
    Table[AO],
    IF (
    Table[AK] = Table[AP],
    Table[AN],
    BLANK()
    )
    )
    )
    )
    )

     

  • Sorry bhanu_gautam  I should of been more discripitive as you've added tables into the above. I have not used DAX query before. Is there a way based on the below? 

     

    I have attached below the PBI report

     

     

    This is excel report and formula I am trying to replicate. 

     

    =IF(AND($I3="Optilite Special Protein Analyser",AO3<>"",$AL3<>AP$2),"",IF(AND($I3="Optilite Special Protein Analyser",$AL3=AP$2),$AN3,IF($AM3<AP$2,"",IF(AO3<>"",AO3,IF($AK3=AP$2,$AN3,"")))))

     

    • bhanu_gautam's avatar
      bhanu_gautam
      Icon for Super User rankSuper User

      timward10 , Go to modelling tab and select Calculated column and paste this code there or share sample data with me

      • timward10's avatar
        timward10
        Icon for Helper II rankHelper II

        Hi bhanu_gautam, unable to upload sample data, so shared the table below. The formula doesn't work when adding it into the modelling tab. 

         

        Thanks

         

        Product NameRevenue Start DateItem 1 Revenue DateContract End DateSplitJan-25Feb -25Mar-25April-25May-25
        Item 101 January 202501 April 202501 September 202511    
        Item 201 March 202501 August 202501 December 2025105105    
        Item 301 June 202501 September 202501 January 202644