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
reynaldo_malave
Helper III
Helper III

Keep last month sales at store level

Hi guys,

 

The overall challenge am facing is comparing last month store sales to determine wether reaches a certain amount and make a decision based on that. The problem am stuck with is it keeps aggregating at the filter context of the visual meaning it when i put employees in the visual it calculates last month sales based on the employee and not the store.

for example 

StoreLastMonthSales
1100
2120
3150

 

Actual visual

 

StoreEmployeeLastMonthSales
1175
1225
2180
2240
3150
3275
3325

 

Desire result

StoreEmployeeLastMonthSales
11100
12100
21120
22120
33150
33150
33150

 

Any help would be greatly appreciated

 

Thanks,

 

Reynaldo

1 ACCEPTED SOLUTION
v-yaningy-msft
Community Support
Community Support

Hi, @reynaldo_malave 

Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.

 

vyaningymsft_0-1706664956130.png

Measures:

 

TotalSales =

CALCULATE (

    SUM ( 'Table'[LastMonthSales] ),

    ALLEXCEPT ( 'Table', 'Table'[Store] )

)

 

 

If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
v-yaningy-msft
Community Support
Community Support

Hi, @reynaldo_malave 

Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.

 

vyaningymsft_0-1706664956130.png

Measures:

 

TotalSales =

CALCULATE (

    SUM ( 'Table'[LastMonthSales] ),

    ALLEXCEPT ( 'Table', 'Table'[Store] )

)

 

 

If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

vicky_
Super User
Super User

You need to create a measure to remove the employee row context, which can be done using the REMOVEFILTER function:
Last Month Store Sales = CALCULATE([Sales], REMOVEFILTER(Table[Employee]))

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.