Forum Discussion

Da_clint's avatar
Da_clint
Frequent Visitor
3 years ago
Solved

If and statements between different tables

Hi im trying to based on 2 conditions from different tables give a decided value or else 0.

 

Have tried to put in a custom column:

 

if([Besparelse] = 1 and (#"Kontoplan"[Mva Norge] =>0 then 0,25 else 0))

 

 

[Besparelse] = from primary table

Kontoplan = is the second table

 

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Da_clint ,

     

    Here I create a sample to have a test.

    Kontoplan:

    Primary:

    Custom column:

    if [Besparelse] = 1 and 
    List.Sum(
    let 
    _Customer = [Customer]
    in
    Table.SelectRows(Kontoplan, each [Customer] = _Customer)
    [Mva Norge]) >= 0 then 0.25 else 0

    Here I add this custom column into Primary table. Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

    • Da_clint's avatar
      Da_clint
      Frequent Visitor

      Thank you Rico

       

      I see that this probably also will work, but I solved it by bringing in the data to the same table & then use a IF && function in DAX