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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MattiaAcc
New Member

Adaptable cumulative curve per date range

Hello everyone,

I need some help for the formula below: 

MattiaAcc_0-1681203824388.png

I managed to put the field "Collezione" as a filter but I need to also make the cumulative filterable for the date range. The field "Date" of the table "Calendario" would be great but I don't know how to put that condition. 

If I currently put a filter on "Collezione" the curve shows me the correct cumulative sum in the whole date range for the selected collection, but I need also to restrict the date range.

 

Here the text:

Cumulata volumi =
var numeratore =  CALCULATE( SUMX( Articoli,Articoli[Venduto]),
                                FILTER( ALLEXCEPT('DB Prove ingegneria', 'DB Prove ingegneria'[*Collezione]), NOT(ISBLANK('DB Prove ingegneria'[7_Approvato])) &&'DB Prove ingegneria'[7_Approvato] <= MAX(Calendario[Date])))
var denominatore = CALCULATE( SUMX( Articoli,Articoli[Venduto]),
                                FILTER( ALLEXCEPT('DB Prove ingegneria','DB Prove ingegneria'[*Collezione]), 'DB Prove ingegneria'[7_Approvato] <= MAX(Calendario[Date])))
return
DIVIDE(numeratore,denominatore)
 
Anyone can help me?
Thanks
2 REPLIES 2
FreemanZ
Super User
Super User

hi @MattiaAcc 

try like:

Cumulata volumi =
var numeratore =  
CALCULATE( 
    SUMX( Articoli,Articoli[Venduto]),
    KEEPFILTER(
    FILTER( 
        ALLEXCEPT('DB Prove ingegneria', 'DB Prove ingegneria'[*Collezione]), 
        NOT(ISBLANK('DB Prove ingegneria'[7_Approvato])) 
            &&'DB Prove ingegneria'[7_Approvato] <= MAX(Calendario[Date])
    ))
)
var denominatore = 
CALCULATE( 
    SUMX( Articoli,Articoli[Venduto]),
    KEEPFILTER(
    FILTER( 
        ALLEXCEPT('DB Prove ingegneria','DB Prove ingegneria'[*Collezione]), 
        'DB Prove ingegneria'[7_Approvato] <= MAX(Calendario[Date])
    ))
)
return
DIVIDE(numeratore,denominatore)

 

I tried and it's not working. It just makes the amount always equal to 1

MattiaAcc_0-1681371234801.png

 

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.