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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
KGOLSEN
Frequent Visitor

IF Year = X, and Name =Y, return SUM of Sales (Show Prior Year & Current Year sales for accounts)

I am very new at Power BI and perhabs I am diving too deep to start off...

 

I feel like the solution to my question should be fairly straight forward and maybe it's my novice stature that is frustrating me?

 

Table1 contains a mass of financial data. There is one column for fiscal year (2015 - 2019).

Table2 contains account names that are linked to table 1.

Table1 contains the amount of sales in dollars.

 

I currently have a table that is showing the Account Name, Region, and Total Sales and am looking to just add prior year sales and current year sales for the respective accounts.

 

All I want to do is answer the following:

IF Table1[FISCAL YEAR] = 2018, AND equals Table2[Account Name], Show SUM of Table1[SALES]

Additionally

IF Table1[FISCAL YEAR] = 2019, AND equals Table2[Account Name], Show SUM of Table1[SALES]

 

Please and thank you! 🙂

1 ACCEPTED SOLUTION
KGOLSEN
Frequent Visitor

My team lead figured out what I needed.

 

Create a measure in a Facts table and then add to a visualization.

Prior Year Sum

Calculate(Sum(ALL SALES TABLE[SALES]),ALL SALES TABLE[FISCAL YEAR]=”2018”

 

Current Year Sum

Calculate(Sum(ALL SALES TABLE[SALES]),ALL SALES TABLE[FISCAL YEAR]=”2019”

View solution in original post

2 REPLIES 2
KGOLSEN
Frequent Visitor

My team lead figured out what I needed.

 

Create a measure in a Facts table and then add to a visualization.

Prior Year Sum

Calculate(Sum(ALL SALES TABLE[SALES]),ALL SALES TABLE[FISCAL YEAR]=”2018”

 

Current Year Sum

Calculate(Sum(ALL SALES TABLE[SALES]),ALL SALES TABLE[FISCAL YEAR]=”2019”

v-xicai
Community Support
Community Support

Hi @KGOLSEN ,

 

I am not sure what desired result would you want, could you please share your sample data or desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Best Regards,

Amy

 

Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

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

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.