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

compare Current year sales with last Year

Hi Guys,

        I am comparing the current year with last year sales and i used SAMEPERIODLASTYEAR for calclating the last year value but the problem is if i click the year filter say 2018 it shows the 2018 value in the current year but it is not showing the last year 2017 value. it shows the last year as blank. I had connected the data source Live through SSAS Cube.  Please help me with it and provide me an alternative solution.

12 REPLIES 12

Hi @Anonymous,

 

did you solve your problem?


If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

hi @mwegener ,

                     I could'nt able to solve it.

Hi @Anonymous ,

 

could you post your YTD_1 DAX formula?

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Ashish_Mathur
Super User
Super User

Hi,

You must create a Calendar Table with a proper relationship from the Date column of your Data Table to the Date column of your Calendar Table.  In the Calendar Table, create a calculated column to extract the Year

Year = Year(Calendar[Date])

Create a slicer of Year and select any one year.

Write these measures

Revenue = SUM(Data[Values])

LY revenue = CALCULATE([Revenue],PREVIOUSYEAR(Calendar[Date])

Hope this helps.


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

@Ashish_Mathur  I am already having the calender table as dim date and when i used it iam still facing the same issue

YTD_1 = sum(Table1[Amount])

 

Capture (1).PNG

Hi,

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


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

Hi @Anonymous ,

I create a simple example and it works well.

cy.giffy.jpg

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Icey  So you saying toi create a many to one bi directional filter ????

Icey
Community Support
Community Support

Hi @Anonymous ,

It's just this relationship in the example I created. What is your data format? If you don't mind, please share me some sample data, not real data.

 

Best Regards,

Icey

Hi @Anonymous ,

 

please check if the date table is mark as date table.

 

https://docs.microsoft.com/en-us/analysis-services/tutorial-tabular-1200/lesson-3-mark-as-date-table

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Hi @Anonymous ,

 

do you use a date table?

Could you post your DAX and a screenshot of the model view?

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Anonymous
Not applicable

@mwegener  Hi,

                        I have shared the pic of the dax and the model

YTD_1 = sum(Table1[Amount])

 

Capture (1).PNG

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.