Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I posted this question and received some useful information that helped me understand measures and such. However, I realize now I forgot an important detail.
I'm using a slicer to select "customer", and want to display a card that shows total sales for that customer's "account". What I failed to mention is there are multiple accounts.
Example
| Customer | Account | Sale Amount | Year |
| John Doe | SuperContractors | $20 | 2024 |
| John Doe | SuperContractors | $15 | 2024 |
| Tommy Boy | SuperContractors | $30 | 2024 |
| Tommy Boy | SuperContractors | $20 | 2023 |
| Jane Seymour | Beautiful Builds | $35 | 2024 |
| John Doe | SuperContractors | $15 | 2023 |
| Jane Seymour | Beautiful Builds | $40 | 2024 |
What I'm looking to display is, based on a Page Filter for Year - say selected on 2024 for example:
Slicer Select: John Doe
Customer Card: $35
Account Card: $65
If I switch the filter to 2023 and keep it on John Doe, the cards would update to:
Customer Card: $15
Account Card: $35
The solution I recieved seems to work, but assumes all entries in the table are the same account.
AccountTotalSales =
CALCULATE(
SUM('Sales'[SalesAmount]),
ALL('CustomerTable'[CustomerID])
)
How do I simultaneously have it know John Doe's account, but summarize more than just John Doe?
Solved! Go to Solution.
Try this measure. The VALUES function captures the Account filter context.
Account Total Sales =
CALCULATE (
SUM ( Sales[Sale Amount] ),
ALL ( CustomerTable ),
VALUES ( CustomerTable[Account] )
)
Since Account is an attribute of Customer, I included Account in CustomerTable:
Proud to be a Super User!
Try this measure. The VALUES function captures the Account filter context.
Account Total Sales =
CALCULATE (
SUM ( Sales[Sale Amount] ),
ALL ( CustomerTable ),
VALUES ( CustomerTable[Account] )
)
Since Account is an attribute of Customer, I included Account in CustomerTable:
Proud to be a Super User!
Thank you.
This made me realize I needed to clean up my tables and relationships, and once I did that this was super easy and completely worked!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 42 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 69 | |
| 32 | |
| 32 | |
| 32 |