Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Filter Context not propagating with IF function used in a measure

Hi All,

 

Having an issue with a basic IF logic used in a measure. My IF statement is as follows:

 

Volume Check = 
IF(
    [Volume] > 10000,
    "Flag",
    "Ok"
)

 

 

The measure works and my table visual does what I want:

Project NameLaunch DateProject NumberVolume Check
A10/15/202012345Ok
B1/5/202524690Ok
C4/7/202449380Flag
D4/1/202498760Ok
E4/10/202319752Ok
F4/8/202439504Ok
G4/3/202379008Flag

 

My issue occurs when I drag a field into the table visual from one of my other lookup tables. Example: if I drag in the "Business Name" field from the Business table it repeats everything like you would see if a relationship did not exist between lookup and source tables. The table looks as follows:

BusinessProject NameLaunch DateProject NumberVolume Check
Business 1A10/15/202012345Ok
Business 2A10/15/202012345Ok
Business 3A10/15/202012345Ok
Business 1B1/5/202524690Ok
Business 2B1/5/202524690Ok
Business 3B1/5/202524690Ok
Business 1C4/7/202449380Flag
Business 2C4/7/202449380Flag
Business 3C4/7/202449380Flag
Business 1D4/1/202498760Ok
Business 2D4/1/202498760Ok
Business 3D4/1/202498760Ok
Business 1E4/10/202319752Ok
Business 2E4/10/202319752Ok
Business 3E4/10/202319752Ok
Business 1F4/8/202439504Ok
Business 2F4/8/202439504Ok
Business 3F4/8/202439504Ok
Business 1G4/3/202379008Flag
Business 2G4/3/202379008Flag
Business 3G4/3/202379008Flag

 

The issue is not my data model. I believe I need to force the filter context with my IF measure. Does anyone know what I am doing wrong here and how I can fix this issue? Thank you!

  • tamerj1's avatar
    tamerj1
    4 years ago

    Anonymous 

    You can modify your measure

    Volume Check =
    IF ( [Volume] > 10000, "Flag", IF ( [Volume] > 0, "Ok" ) )

    or

     

    Volume Check =
    IF ( NOT ISBLANK ( [Volume] ), IF ( [Volume] > 10000, "Flag", "Ok" ) )

11 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Anonymous 

    When adding columns from different tables the engine creates a cross join table generating all possible unique combinations. Allways add columns as measures perhaps using SELECTEDVALUE 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi tamerj1 

       

      Thank you for the response! What would the DAX look like for this combined with my measure above?

      • tamerj1's avatar
        tamerj1
        Icon for Community Champion rankCommunity Champion

        It depends on your data model. Can you please share a screenshot of you data model and the expected results table indicating the the table to which each column belongs.