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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

SAMEPERIODLASTYEAR() only total at the bottom

I only get total of the SAMEPERIOD LAST YEAR at the bottom. I can not get numbers by months. Any ideas?

round23_0-1613428954725.png

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

You could add a Date table into your model, and create a relationship between Date[Date] and Klant[Date] columns (one-to-many & single direction). Then use Date table's columns in Time Intelligence functions and Table visuals. When you use Date columns from Other tables, you may get blank values because of the filter context in a visual.

For example,

Sales LY = CALCULATE(SUM('Table'[Sales]),SAMEPERIODLASTYEAR('Table'[Date]))
Sales LY modified = CALCULATE(SUM('Table'[Sales]),SAMEPERIODLASTYEAR('Date'[Date]))

021805.jpg

See difference of the results:

021806.jpg

 
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

You could add a Date table into your model, and create a relationship between Date[Date] and Klant[Date] columns (one-to-many & single direction). Then use Date table's columns in Time Intelligence functions and Table visuals. When you use Date columns from Other tables, you may get blank values because of the filter context in a visual.

For example,

Sales LY = CALCULATE(SUM('Table'[Sales]),SAMEPERIODLASTYEAR('Table'[Date]))
Sales LY modified = CALCULATE(SUM('Table'[Sales]),SAMEPERIODLASTYEAR('Date'[Date]))

021805.jpg

See difference of the results:

021806.jpg

 
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.
edhans
Super User
Super User

Klant[Sample_Date] doesn't look like a date table to me. You need to use the Date[Date] field (or whatever you name it) from the true date table, not a date field from one of the other tables. 

 

I'd need to see your model, or better yet your PBIX file, but I suspect this is a modeling issue. The Time Intelligence functions work over date tables, not any date field.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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