Previous Year to Date -Current Week -Card Visual shows wrong value

I have these measures:



CALCULATE([PY Count of SalesID]; DATESYTD(Kalender[Dato])))


PY Count of SalesID =
CALCULATE([Count of SalesID] ; DATEADD(Kalender[Dato] ; -1; YEAR))

I show them in a line chart and in a Card Visual which are both filtered by the same Week-slicer.

Both visuals agree, when I select weeks that are in the past.

But when I select the current week (today is Monday of week 6 2024),
the Line chart shows the value 7679 orders (which is the running total for 2023 up until Monday of week 6 2023 -the value I want),
but the Card vizual shows the value of 9361, which is the running totalt including all 7 days of week 6 in 2023.

I would like the Card Visual to show the same value as the line chart.

What am I missing here?

Week in the past:

Current week:

Can you send your pix or a sample of your data (it may be fictitious)?

I’m sorry, I am not allowed to send the .pbix file, since it contains real and sensitive data from my company.

But I can tell you how it is structured, and what I have tried so far.

I have a dataset, which is just a datamodel.
It is a big data set. almost like my own home made copy of the ERP system.
It updates every night and all my reports get their data from this dataset.

In this report, I use SALESIDs from SALESTABLE and my custom Calendar or Date-table (Kalender).

My question is more: Has any one else experienced that different visualisations provide different numbers from the same measures under the same filtercontext?

I have tried drilling up on my line chart to get the data displayed week by week or month by month.

When I do that, the line for Previous Year To Date (PYTD) continues after today’s date in spite of my measure telling it to insert BLANK() after TODAY().

So I’m thinking maybe this is just a standard thing that I thought I could get out of by applying IF(SELECTEDVALUE(Kalender[Dato]>TODAY();BLANK() to my measure.
But maybe it just doesn’t work that way?

Maybe by only using SELECTEDVALUE on date level, It only shows BLANK() when I sort day by day and not when I sort in any other date-related way?

And maybe the Card Visual always accumulates data for the whole filterperiod?
-In this case I filter by week (Slicer), but I want results by date for current week (Line Chart AND Card), and maybe that is just not possible?

I don’t know. That’s why I thought, I would ask all the clever minds in here :slight_smile:

I tried to simulate your scenario with this fictitious data. See if it helps. If it doesn’t help, can you do your scenario in it?
previousyear.pbix (102.6 KB)