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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.