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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Bokazoit
Responsive Resident
Responsive Resident

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.