Forum Discussion

Ber001's avatar
Ber001
Regular Visitor
5 years ago

DAX function with conditions

Dear,

 

I'm getting crazy by trying to do the fonction below for a couple of days...

 

I have to tables :

The first one : A date table 1 with a column 1 including the first day of each month

The seconde one : A Budget table 2 with multiple columns but the 3 concenred on are : Estimated Revenue, Date IN, Date OUT.

 

On top of that I have a table and a chart with the real revenue (vertical axis) and the months (Horizontal axis)

My goal is to add a "budget line" on this chart but the budget change month by month.

So would like to have a calculated column (in the Data table) or a mesure to have the sum of the "budget revenu" month by month.

 

I tried a mesure : SMUX (Table 2; IF (AND (RELATED('Table1'[Column1]) >= [Date IN]; RELATED('Table1'[Column1]) <= [Date OUT]); [Estimated Revnue]))

 

But impossible to show this in a shart combined with month by month view...

 

I've tried a lot of other things but anything works... Maybe will I have to do this with Power Query but I have to use data in 2 different tables...

 

Thank you for your help.
Bertrand