Forum Discussion

samueldegrace's avatar
samueldegrace
New Member
9 years ago
Solved

Table and relationships

Hello,    I'm having a hard time trying to find a solution to a problem. I created a table that looks a like this:          Now, I only want to show rows where [Montant] is higher than [...
  • richbenmintz's avatar
    9 years ago

    You can create a measure that looks to see if the montant > budget

    test measure = if(sum(montant) > sum(budget), true(), false())

     

    you can then add this measure to your visual filters use it to filter the data. 

    or you can set montant to blank() if the budget is greater

    like montant = if(sum(montant) > sum(budget), sum(montant), blank())

    and then filter the visual to only show rows with non blank Montant values.

     

    Hope that helps,

     

    Richard

  • TomMartens's avatar
    9 years ago

    Hey,

     

    maybe you can try the RELATEDTABLE() used in a CALCULATE() like so

    Bust = 
    IF(CALCULATE(SUM('CHARTE'[Montant]), RELATEDTABLE('CHARTE')) >
    CALCULATE(SUM('BUDGET'[Budget]), RELATEDTABLE('BUDGET')),1,0)

    RELATEDTABLE() is the opposite from RELATED. RELATETABLE pulls from the many side, for this reason it is necessary to provide an aggregate function.

     

    Hope this helps

    Regards