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
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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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