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
Bokazoit
Responsive Resident
Responsive Resident

How to ignore filter context in a variable for my measure

This measure:

 

Number of cases = 

VAR MinDato = MIN(DimDato[Date])

RETURN

CALCULATE(
    DISTINCTCOUNT(FactArvesager[ArvesagsKey]),
    FactArvesager[Forventet afsluttet Dato] >= MinDato &&
    FactArvesager[Bostarts Dato] < MinDato &&
    (FactArvesager[Realiseretarv Dato] = BLANK() || FactArvesager[Realiseretarv Dato] >= MinDato)
)

is not working as intented because of the VAR part.

 

The Variable is calculated in context to each row. So instead of the variable being fixed to the minimum value of my date filter:

Bokazoit_0-1650529095726.png

 

it is somehow being calculated pr. row.

I need the measure to calculated from the VAR being = 01-04-2022 and if I change the filter to another date it will change to that accordingly.

 

For now my only solution is to dublicate my date dimension and have that seperated. But that makes the model difficult for users to understand.

2 REPLIES 2
amitchandak
Super User
Super User

@Bokazoit , if DimDato is joined

 

Number of cases =

VAR MinDato = MIN(DimDato[Date])

RETURN

CALCULATE(
DISTINCTCOUNT(FactArvesager[ArvesagsKey]),filter( FactArvesager ,
FactArvesager[Forventet afsluttet Dato] >= MinDato &&
FactArvesager[Bostarts Dato] < MinDato &&
(FactArvesager[Realiseretarv Dato] = BLANK() || FactArvesager[Realiseretarv Dato] >= MinDato),
all(DimDato)
))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

That does not work. The MIN(DimDato[Date]) seems calculated per row. I seems to have a difficult time explaining my issue. I have this thread that explains it deeper:

 

https://community.powerbi.com/t5/Desktop/Why-is-my-table-aggregates-incorrect-but-the-total-is-corre...

 

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.

Top Solution Authors