Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

DAX - Evolution total - Row context

 

 

 Hello, I have a problem with an evolution formula in dax 

 

Numbers in red are the values the "%Progression_AFN_apres_event" formula should use to compute the result in red.

Red value under %Progression_AFN_apres_event is the desired result. 

Red values under NB_AFN_après_event AND NB_AFN_N-1_apres_event are values that should be used to compute the formula

 

 

Sans titrefdsfsfsf.png

 

// Formula to update

 

%Progression_AFN_apres_event =
VAR a = [NB_AFN_après_event]
VAR b = [NB_AFN_N-1_apres_event]
RETURN
    CALCULATE( AVERAGEX(AFN,
    CALCULATE(
        IF(
            AND(a > 0, b > 0),
            DIVIDE(a - b, b, BLANK()),
            BLANK()
        ) )
       
    )) NB_AFN_après_event = 
 var a =  [Event_Date_Max] 
 var afn_ = CALCULATE(sum(AFN[AFN]),FILTER(AFN,AFN[DATE_CREATION]> a ))
return  afn_

 

 

 

 

 

 

 

 

 

 

NB_AFN_N-1_apres_event = 
    var a = EDATE([Event_Date_Max],-12)
    var today_ly = EDATE(TODAY(),-12)
    var b = CALCULATE(sum(AFN[AFN]), DATEADD( dim_date[Date],-1,YEAR ),dim_date[Date]>a, dim_date[Date] <= today_ly)
    return b 

 

 

 

 

 

 

Here is a sample of AFN table, feel free to tweak it

 

CODE_COURTIERDATE_CREATIONAFNMax_event_date
I4055915/11/20222726/09/2023
I4168620/02/20232712/06/2023
I9621031/01/20222522/06/2023
I10733731/01/20232112/06/2023
I4168606/03/20232112/06/2023
I4168613/12/20221812/06/2023
I9618326/12/20221712/06/2023
I9621027/01/20221622/06/2023
I9622230/11/20221512/06/2023
I9891715/12/20221220/06/2023
IA9646123/01/20231217/04/2023
IA9747203/01/20221208/06/2023
I9738909/11/20221220/06/2023
I9764620/09/20221131/05/2023
I9622212/12/20221012/06/2023
I9764627/09/20221031/05/2023
I4168604/10/2022912/06/2023
I10703426/01/2023822/06/2023
I9776427/12/2022822/06/2023
I10733701/02/2023812/06/2023
1 REPLY 1
Anonymous
Not applicable

up

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.