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
FPP
Frequent Visitor

My Last Year Measure is not working for 2022

Hi, I have following Measures:

E Count =

VAR CountD =
CALCULATE (
COUNTROWS (
FILTER (
SUMMARIZE (
FILTER ('Losses', 'Losses'[Status] = "closed")
, 'Losses'[CK], "ExpenseSum", SUM ('Losses'[Expense])
),
[ExpenseSum] <> 0
)
),
USERELATIONSHIP ('Calendar'[Date], 'Losses'[ECD])
)

RETURN
CountD


E Count LY =
CALCULATE (
[E Count],
SAMEPERIODLASTYEAR ('Calendar'[Date])
)

I have table visual with a filter of iSYTD set to TRUE.  This limits the table to only include values in older years where this year has the same dates.  In other words: Only include Jan 1,2019-Jan24, 2019 when adding up 2019.
All of the values are correct except the last year.
Example:

YearE CountE Count LY
2019604 
2020716604
2021783716
20228451182

How do I fix E Count LY for my last year (2022)?


7 REPLIES 7
v-yalanwu-msft
Community Support
Community Support

Hi, @FPP ;

So your problem has been solved?

 If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

If not, could you share a simple after removing the sensition  information?


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I now have a file.  How do I upload it?

amitchandak
Super User
Super User

@FPP , Make sure Calendar table is marked as date Table and Year is coming from Calendar.

also try

E Count LY =
CALCULATE (
[E Count],
dateadd('Calendar'[Date], -1, year)
)

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

I am trying to build a pbix with fake data.  I am having trouble replicating the issue.  I will keep working on it.

My Calendar table is marked as a date table.  I tried your DAX, there were no changes.

@FPP ,
Can you share  a sample pbix after removing sensitive data.

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.