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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Bokazoit
Post Patron
Post Patron

Why is my table aggregates incorrect but the total is correct?

My datamodel:

 

Bokazoit_0-1650521534356.png

The active join is between DimDato - my date table and the coloumn [Forventet afsluttet Dato]

 

My measure:

 

 

 

 

Count = 

VAR MinDate = CALCULATE(MIN(DimDato[Dato]),ALLSELECTED(DimDato[Dato]))

RETURN

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

 

 

 

Here is the odd part. When I build my measure everything is fine. it counts correctly and the total is correct

Bokazoit_1-1650521863492.png

 

But if I add a date from my Date dimension (DimDato) things start to look weird:

 

Bokazoit_2-1650522007906.png

 

For some reason it adds the BoNummer (MemberIds) for 62026,62027 & 62028

 

But the total is correct, and according to my measure, they should not be counted. If I add the MinDate to see what it calculates it does though make sense:

 

Bokazoit_3-1650522866593.png

But the purpose of adding the variable to  my measure, this part:

 

VAR MinDate = CALCULATE(MIN(DimDato[Dato]),ALLSELECTED(DimDato[Dato]))

 

is to get the minmum date selected in the date slicer, but that seems not to be the case.

 

I simply can not figure it out. The key is the date variable that is suppose to be that same value for every row but apparently is not

2 REPLIES 2
DataInsights
Super User
Super User

@Bokazoit,

 

Try changing the four bidirectional relationships to unidirectional. Bidirectional relationships can cause numerous isues.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Sorry but it is a questionary, so that is actually a model I got in here and will not work without

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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