Forum Discussion

tracyhopaulson's avatar
tracyhopaulson
Icon for Resolver I rankResolver I
7 years ago
Solved

Need HELP with DAX comparison

I have 2 tables (PO & Item) that have the 2 elements I am doing a comparison.  If the Line Revision and the PO Revision for each PO is the different, then I want to mark it "True" for further analysis.  I've tried Rev Comparision= IF(PO[PORevision]=Item[ItemRevision], "True", "False") but it's giving me error! for example, Line 7 where the revision is not the same, I would want to mark it false.   Can someone help please?

  • MFelix's avatar
    MFelix
    7 years ago

    Hi tracyhopaulson ,

     

    Based on the file you sent me trough private message do the following:

    • Create the following measure:
    RevComparision = MAX(Items[Revision]) = MAX(PurchaseOrderLines[Revision])
    • Add the PurchaseOrderLines[Line] to your filter pane and select is not blank, final result is below:

    Comparision.png

    Regards,

    MFelix

4 Replies

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Icon for Community Support rankCommunity Support

    tracyhopaulson ,

     

    You may try the DAX below to add a calculated column.

    Column =
    IF ( RELATED ( PO[PORevision] ) = 'Item'[ItemRevision], "True", "False" )
    
    • tracyhopaulson's avatar
      tracyhopaulson
      Icon for Resolver I rankResolver I

      I entered your formula and got error that the ItemRevision column either doesn't exist or doesn't have a relationship to any table available in the current context. 

       

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

        Hi tracyhopaulson ,

         

        Based on the file you sent me trough private message do the following:

        • Create the following measure:
        RevComparision = MAX(Items[Revision]) = MAX(PurchaseOrderLines[Revision])
        • Add the PurchaseOrderLines[Line] to your filter pane and select is not blank, final result is below:

        Comparision.png

        Regards,

        MFelix