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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Bokazoit
Continued Contributor
Continued Contributor

Accumulate quarters

This meaure works well for month but as soon as I drill to quarter it gives me accumulated up till last quarter i.e. Q1. I need it to show for Q2 also even though it is not finished yet:

acc =

VAR __MaxYT = MAX(DimDato[År])
var __MaxDT = max(DimDato[Dato])
var __TD = TODAY()
var __Rtotal =
CALCULATE(sum(FactFinans[#Bogførtbeløb]),
Filter(
All(DimDato),
DimDato[År] = __MaxYT
&& DimDato[Dato] <= __MaxDT)
)

RETURN
IF (__MaxDT >= __TD, BLANK(), __Rtotal)
 
The IF part blank out numbers in future, and I think that is where I need the helt
1 REPLY 1
daxer-almighty
Solution Sage
Solution Sage

acc =
VAR Today_ = TODAY ()
var EffectiveDates =
    INTERSECT(
        DISTINCT( DimDato[Dato] ),
        CALCULATETABLE(
            DISTINCT( DimDato[Dato] ),
            DimDato[Dato] <= Today_,
            REMOVEFILTERS( DimDato )
        )
    )
VAR RTotal =
    CALCULATE (
        SUM ( FactFinans[#Bogførtbeløb] ),
        CALCULATETABLE(
            DATESYTD( DimDato[Dato] ),
            EffectiveDates
        ),
        REMOVEFILTERS( DimDato )
    )
return
    RTotal

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.