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

DAX

HI,

I want to compare the sales amount of several shops with previous year. All my current year and previous year values are in same table. How to filter the value should calculate only if both the year has same shops? I'm using the below dax, If I use this power BI should not detect the new shops.

 

Net_sales_Performance = SUMX(CALCULATETABLE('Table1',except(VALUES('Table1'[storeID]),VALUES('Table2'[SHOP NO]))),'Table1'[Performance])
 
Here, I'm not supposed to use the Table 2. Help me with the solution asap.
 
Note: Simply current year and previous year has same shop Id so that it can compare with corresponding shops.
 
 
TIA
1 ACCEPTED SOLUTION

I wrote an article about this a few years ago. https://powerpivotpro.com/2015/08/nested-sumx-or-dax-query/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

2 REPLIES 2

I wrote an article about this a few years ago. https://powerpivotpro.com/2015/08/nested-sumx-or-dax-query/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Anonymous
Not applicable

Thank you so much Matt!! Its really worked out !! 

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.