Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am building a profit/margin dashboard for multiple clients.
I am referencing one table for all of this; 'Budgets'.
I have a separate page for each client and each page is filtered by the client code.
My calculation works great for individual clients, but the moment I filter by more than one client code on the page my matrix breaks and says the following:
There are two clients that require a different Earned formula. If the current page filter equals "H1" or "M1" then do Earned_Overall, otherwise do Earned_Market. If I filter the page for two markets (Lets say "A1" and "H1") the matrix breaks.
Earned =
VAR Earned_Overall =
[Billing]
- IF (
[Delivery%] >= [Guarantee%],
0,
( [Guarantee%] - [Delivery%] ) * [Billing]
)
VAR Earned_Market =
SUMX (
SUMMARIZE ( Budgets, Budgets[BuyspecName], Budgets[Market], "Value", [ECalc] ),
[Value]
)
RETURN
SWITCH (
TRUE (),
VALUES ( Budgets[cclient2] ) = "H1" || VALUES ( Budgets[cclient2] ) = "M1",
SWITCH ( TRUE (), ISINSCOPE ( Budgets[BuyspecName] ), BLANK (), Earned_Overall),
Earned_Market
)
ECalc =
VAR Earned =
[Billing]
- IF (
[Delivery%] >= [Guarantee%],
0,
( [Guarantee%] - [Delivery%] ) * [Billing]
)
'Budgets' table
I need to get this Earned formula to function when multiple client codes are filtered in.
Solved! Go to Solution.
Hi @DJSwezey
You can try the following measure.
Earned =
VAR Earned_Overall =
[Billing]
- IF (
[Delivery%] >= [Guarantee%],
0,
( [Guarantee%] - [Delivery%] ) * [Billing]
)
VAR Earned_Market =
SUMX (
SUMMARIZE ( Budgets, Budgets[BuyspecName], Budgets[Market], "Value", [ECalc] ),
[Value]
)
RETURN
SWITCH (
TRUE (),
SELECTEDVALUE ( Budgets[cclient2] ) = "H1"
|| SELECTEDVALUE ( Budgets[cclient2] ) = "M1", IF ( NOT ( ISINSCOPE ( Budgets[BuyspecName] ) ), Earned_Overall ),
Earned_Market
)
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @DJSwezey
You can try the following measure.
Earned =
VAR Earned_Overall =
[Billing]
- IF (
[Delivery%] >= [Guarantee%],
0,
( [Guarantee%] - [Delivery%] ) * [Billing]
)
VAR Earned_Market =
SUMX (
SUMMARIZE ( Budgets, Budgets[BuyspecName], Budgets[Market], "Value", [ECalc] ),
[Value]
)
RETURN
SWITCH (
TRUE (),
SELECTEDVALUE ( Budgets[cclient2] ) = "H1"
|| SELECTEDVALUE ( Budgets[cclient2] ) = "M1", IF ( NOT ( ISINSCOPE ( Budgets[BuyspecName] ) ), Earned_Overall ),
Earned_Market
)
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
8 | |
8 | |
7 |
User | Count |
---|---|
17 | |
13 | |
7 | |
6 | |
6 |