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
Anonymous
Not applicable

What's wrong with my SAMEPERIODLASTYEAR statement?

I'm working through the edx online course, and am trying to generate a simple table showing yearly total revenue, plus a column showing the previous year's revenue.  What I'm getting is a duplicate of the current year's revenue.  Here is my table and the commands I'm using for my columns:

Image 1.jpgImage 2.jpgImage 3.jpg

 

It seems simple enough, but I'm missing something.  Thank you for your help!

 

Mike

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The rows on your table. Where are those years coming from?  Make sure they are now coming from the new date table. 

 

If that still doesnt work, please upload a sample file. 

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

be sure your date table is set as such:

How to Mark as Date Table.png

Anonymous
Not applicable

Nick_M,

 

I now have a defined date table.  I refreshed my view.  I even exited Power BI and restarted it, but my numbers have not changed.

 

Mike

Anonymous
Not applicable

The rows on your table. Where are those years coming from?  Make sure they are now coming from the new date table. 

 

If that still doesnt work, please upload a sample file. 

Anonymous
Not applicable

Nick,

 

That did the trick!  I'm pretty new at this, and I guess I didn't realize the importance of having a separate date table.

 

Thank you for your help and patience!

 

Mike

Anonymous
Not applicable

@Anonymous 

No problem at all. Need a separate date table to make the built in time-intelligence work correctly. Plus you never want to filter ( which is what is happening in a pivot table, slicers, etc) your main (fact) table. Always want smaller tables, like the date table, to be filtered and then "Send" those filters to your bigger fact tables. But that's a grossly simplified explanation. Just takes some time to get used to it. Good luck

Anonymous
Not applicable

If I could sneak a slightly different question in, I'll be done for the day.  I'm trying to create a matrix with Months as rows, and years as columns for YTD numbers.  The months insist on sorting by Month Name.  I tried sneaking MonthNo in to try to sort by that, but I don't see any "sort by" option.

 

Image 6.jpg

Anonymous
Not applicable

Common question and you are pretty much there with having a month number column. In Data view (where all the tables are) navigate to your date table. Select the Month Name column--> Modeling tab in the task bar--> Then you will see a "Sort by Column" with a drop down. Click that drop down and select the month number column. Nothing will change in the table itself, but the order of the months should change in your matrix. 

Anonymous
Not applicable

Bingo!  Boy, there's a lot of nuance to this app.

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.