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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
IAmCare
Frequent Visitor

SamePeriodLastYear

Maybe I am missing something but shouldnt the current for 2017 be the Last for 2018?  Here is my code

Current = CALCULATE(COUNTROWS('FactWholesale'))

Last = CALCULATE([Current],SAMEPERIODLASTYEAR('DimDate'[Date]))

 

578 for 2018 and 594 for 2017 is correct for the current but shouldnt  last for 2018 be the current for 2017 which is 594

 

 

 

 

Capture.JPGmething but shouldnt the cu

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

 

You should not have a year in the Fiscal month column.  In the DimDate Table, extract the Month using the =FORMAT([Date],"mmmm").  Drag this Month column in the visual.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I am getting this error mesage

when i do this

Capture.JPG

Hi,

 

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I think I know what is going on.  Our fiscal month

September 2017 ran from

8/28/2016 -  10/01/2016

 fiscal month

September 2018 ran from

8/27/2017 -  9/30/2017. 

Our fiscal calendar  ends on the last Saturday of the month.  Is there a way to get the sameperiodlastyear to work with this type of monthly set up?

@IAmCare,

 

For any time intelligence function, you could implement a custom DAX formula.

https://www.sqlbi.com/articles/time-intelligence-in-power-bi-desktop/

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I do not know how to share the link to my PBIX without sharing all of my work, which I do not want to do.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.