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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
FPP
Helper I
Helper I

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...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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