Reply
Frequent Visitor
Posts: 7
Registered: ‎10-23-2018

Re: Calculate measurment Dynamicly based on filters

@Stachu
So the solution worked for me to calculate the ARPU_D1
But when I'm trying to do the same for APRU_D2, ARPU_D3 etc.. which is basically uses the same formula just increases the date diff between  +2, +3 I'm receiving an error for circular dependency. 
"A circular dependency was detected: LTV[ARPU_D2], LTV[ARPU_D1_COL], LTV[ARPU_D2]."

I think it somehow related to the MAX ( 'LTV'[Arpdau_all_col])

Do you how to solve this issue? 

Thanks,


Super User
Posts: 866
Registered: ‎06-23-2016

Re: Calculate measurment Dynamicly based on filters

I cannot replicate the issue, I can add new columns without a problem - I adjusted the syntax to match your naming convention, do these work properly?

Column = 
VAR App = 'LTV'[app_id]
VAR Country = 'LTV'[country]
VAR CurrentDate = 'LTV'[install_date]
RETURN
    'LTV'[d1/d0]
        * CALCULATE (
            MAX ( 'LTV'[Arpdau_all_col] ),
            FILTER (
                'LTV',
                'LTV'[app_id] = App
                    && 'LTV'[country] = Country
                    && 'LTV'[install_date] = CurrentDate + 1
            )
        )

and +2 days

Column 2 = 
VAR App = 'LTV'[app_id]
VAR Country = 'LTV'[country]
VAR CurrentDate = 'LTV'[install_date]
RETURN
    'LTV'[d1/d0]
        * CALCULATE (
            MAX ( 'LTV'[Arpdau_all_col] ),
            FILTER (
                'LTV',
                'LTV'[app_id] = App
                    && 'LTV'[country] = Country
                    && 'LTV'[install_date] = CurrentDate + 2
            )
        )
Frequent Visitor
Posts: 7
Registered: ‎10-23-2018

Re: Calculate measurment Dynamicly based on filters

[ Edited ]

Hi @StachuThis is "ARPU_D2"

ARPU_D2 = 
VAR v_App = 'LTV'[app_id]
VAR v_Country = 'LTV'[country]
VAR v_CurrentDate = 'LTV'[install_date]
RETURN
'LTV'[ret_d2]
* CALCULATE (
MAX ( 'LTV'[Arpdau_all_col] ),
FILTER (
'LTV',
'LTV'[app_id] = v_App
&& 'LTV'[country] = v_Country
&& 'LTV'[install_date] = v_CurrentDate + 2
)
)

This is "ARPU_D1"

ARPU_D1 = 
VAR v_App = 'LTV'[app]
VAR v_Country = 'LTV'[country]
VAR v_CurrentDate = 'LTV'[install_date]

RETURN
     'LTV'[ret_d1]
        * CALCULATE (
            MAX ( 'LTV'[Arpdau_all_col] ),
            FILTER (
                'LTV',
                'LTV'[app] = v_App
                    && 'LTV'[country] = v_Country
                    && 'LTV'[install_date] = v_CurrentDate + 1
            )
        )


As you see I'm using a different column for "retention" but it should not affect the circular dependency issue.
The dependency wis between : LTV[ARPU_D2], LTV[ARPU_D1], LTV[ARPU_D2].

All the variables are columns, only "retention" is a measurement ("ret_d1", "ret_d2") 





 

 

Highlighted
Super User
Posts: 866
Registered: ‎06-23-2016

Re: Calculate measurment Dynamicly based on filters

ret_d1 and ret_d2 are measures? what's their syntax? 

if they're based on the LTV table then for sure they would cause the circular reference - they are used in columns, which are part of LTV, which is the table they are based on