Forum Discussion

powerbricco's avatar
powerbricco
Advocate I
1 year ago
Solved

measure which change column reference

Dear All,

i have two tables:

1) Table1

CodeRecl_Code_ARecl_Code_B

0100

AAA 

0150

 BBB

0200

AAABBB

 

2) Table2

 

CodeValueDate
010030001/01/2024
010010016/01/2024
0150-60028/02/2024
020050001/03/2024
020040002/03/2024
0200-1.00001/04/2024

 

 

Tables are in a one-to-many relationship with code as the key.

 

What I need to achieve is a measure where:

if sumx(value) is a positive value, then assign it to Recl_Code_A, else Recl_Code_B.

 

If I filter the following table visual for dates 01/01/2024-31/03/2024, then:

CodeRecl_Code_ARecl_Code_B
0100400 
0150 -600
0200900 

 

If I filter the following table visual for dates 01/04/2024-30/04/2024, then:

CodeRecl_Code_ARecl_Code_B
0200 -1.000

 

Any idea?

Thank you a lot