March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hi all,
I am stumped with what I think ought to be a fairly simple fix, but I just can't get it to work! I'm creating a field team dashboard where the user selects his or her store from the home page, then that filters all other pages to shows results for only that store. All is good so far, this works fine.
My issue now is that I'd like to show sales performance over time versus the average of that store's retailer. There are four retailers, each with around 400 stores.
The data I have to work with looks like this, two tables linked by the Store Name in a many to 1 relationship
"Call File" table
Store name
Retailer
StoreRef (retailer & store ID)
"Sales" table
Sales
Store name
Brand
Product
Solved! Go to Solution.
I assume your Store slicer is from the CallFile table and the relationship is on the StoreName/Store columns. If so, please try these two modifications to your expressions
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
OP has replied but not @ tagged you.
regards
Phil
Proud to be a Super User!
Hi, @briktheprop2
Is your problem solved? Can you provide some sample data removing sensitive data if your problem hasn't been solved?
Best Regards,
Caiyun Zheng
No luck yet unfortunately. My "Sales" table looks like this:
It is filtered from slicers based on another "CallFile" table, which determines the results shown on each table. So if it was filtered to show results for store A01, I would need to be able to calculate the average of all stores that are in retailer A. Does that make sense?
Hi, @briktheprop2
Actually, the Measures from mahoneypat can get the result you want. If you want to calculate the average of all stores that are in retailer A when selecting store A01, you can do a little change to the second Measure.
Retailer Sales =
VAR tol =
CALCULATE (
SUM ( Sales[Sales] ),
ALL ( CallFile[Store Name] ),
VALUES ( CallFile[Retailer] )
)
VAR num =
CALCULATE (
COUNT ( CallFile[Store Name] ),
ALL ( CallFile[Store Name] ),
VALUES ( CallFile[Retailer] )
)
RETURN
DIVIDE ( tol, num )
The Table visual will look like this:
Best Regards,
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I assume your Store slicer is from the CallFile table and the relationship is on the StoreName/Store columns. If so, please try these two modifications to your expressions
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Perfect, thanks you so much @mahoneypat , that worked an absolute treat! VALUES is a new one for me... we live and learn a little more each day!
For your Store Count measure, you will want to put your Store Name and/or StoreRef columns inside the ALL (not retailer). Not sure your sales measures. What is the relationship between the tables (which columns and is it single direction)?
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi Pat, thanks for replying - the two tables have a single direction many (Sales) to one (CallFile) relationship using the store name as the key between the two.
So are you saying the Retailer Store Count measure should be: CALCULATE(DISTINCTCOUNT(CallFile[StoreRef]),ALL(CallFile[Storename])) ? I tried this and it just returns the number of all stores in the Call File table and not the number of stores for the retailer of the store that the report is filtered to, sorry.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
164 | |
116 | |
63 | |
57 | |
50 |