The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
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.
@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)
))
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: