Forum Discussion

D_PBI's avatar
D_PBI
Icon for Post Partisan rankPost Partisan
1 year ago
Solved

Multiple USERELATIONSHIPS functions within an AND and within a CALCULATE

Hi, I have two inactive relationships between the [__dimDate] and [agreement] tables, those being: __dimDate[Date] <> agreement[TerminatedDate] __dimDate[Date] <> agreement[ExpirationDate] I'm ...
  • mark_endicott's avatar
    1 year ago

    D_PBI - You need to take the USERELATIONSHIP filters out of the FILTER statement, and add them as additional filters. 

     

    Also, I would not recomment using FILTER( 'Table', 'column' ) as you have, this is a classic anti pattern and will result in a slower calculation, you should filter a column rather than a table. Here is a good article for this: https://www.sqlbi.com/articles/filter-columns-not-tables-in-dax/

     

    One final thing, I would recommend simplfying your final condition to use NOT IN {"Value1", "Value2" } etc.

     

    I hope this helps, if you need more please provide the DAX code outside of a screenshot and some sample data. 

     

    If I answered your question please mark my post as the solution, it helps others with the same challenge find the answer!

  • v-sgandrathi's avatar
    v-sgandrathi
    1 year ago

    Hi D_PBI,

     

    I wanted to check if you had the opportunity to follow up on our previous conversation. If yes can you please provide the sample data so that we can provide you with the accurate and correct solution. 

    Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.

     

    Thank you.