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.
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
Store | LastMonthSales |
1 | 100 |
2 | 120 |
3 | 150 |
Actual visual
Store | Employee | LastMonthSales |
1 | 1 | 75 |
1 | 2 | 25 |
2 | 1 | 80 |
2 | 2 | 40 |
3 | 1 | 50 |
3 | 2 | 75 |
3 | 3 | 25 |
Desire result
Store | Employee | LastMonthSales |
1 | 1 | 100 |
1 | 2 | 100 |
2 | 1 | 120 |
2 | 2 | 120 |
3 | 3 | 150 |
3 | 3 | 150 |
3 | 3 | 150 |
Any help would be greatly appreciated
Thanks,
Reynaldo
Solved! Go to Solution.
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.
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
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.
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
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]))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
100 | |
78 | |
69 | |
62 |
User | Count |
---|---|
141 | |
106 | |
101 | |
85 | |
72 |