Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Here's my custom column:
Solved! Go to Solution.
Hi @fergu513 ,
You can try:
Ext. Sales PY =
VAR MinRC = MIN(Transactions[Retained Control])
VAR MaxRC = MAX(Transactions[Retained Control])
VAR AllZero = MinRC = 0 && MaxRC = 0
VAR AllOne = MinRC = 1 && MaxRC = 1
RETURN
SWITCH(
TRUE(),
AllZero, BLANK(),
AllOne,
CALCULATE(
[03Total_Sales_PY],
Transactions[Whse_Type] = "Branch",
Transactions[Retained Control] = 0 ||
Transactions[ACQUISITION_YR] = 0 ||
ISBLANK(Transactions[ACQUISITION_YR])
),
BLANK()
)
Hope this helps!
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You
Hi @fergu513 ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You
Hi @fergu513 ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You
Hi @fergu513 ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You
Hi @fergu513 ,
You can try:
Ext. Sales PY =
VAR MinRC = MIN(Transactions[Retained Control])
VAR MaxRC = MAX(Transactions[Retained Control])
VAR AllZero = MinRC = 0 && MaxRC = 0
VAR AllOne = MinRC = 1 && MaxRC = 1
RETURN
SWITCH(
TRUE(),
AllZero, BLANK(),
AllOne,
CALCULATE(
[03Total_Sales_PY],
Transactions[Whse_Type] = "Branch",
Transactions[Retained Control] = 0 ||
Transactions[ACQUISITION_YR] = 0 ||
ISBLANK(Transactions[ACQUISITION_YR])
),
BLANK()
)
Hope this helps!
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You
Hi @fergu513 ,
Force SELECTEDVALUE to return 0 if all values are 0.
VAR SelectedRC =
IF(
HASONEVALUE(Transactions[Retained Control]),
VALUES(Transactions[Retained Control]),
IF(
MIN(Transactions[Retained Control]) = 0 && MAX(Transactions[Retained Control]) = 0,
0,
BLANK()
)
)
Then update your switch function.
Hope this helps!
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You!
RETURN
SWITCH(
TRUE(),
SelectedRC = 0,
BLANK(),
SelectedRC = 1,
CALCULATE(
[03Total_Sales_PY],
Transactions[Whse_Type] = "Branch",
Transactions[Retained Control] = 0 ||
Transactions[ACQUISITION_YR] = 0 ||
ISBLANK(Transactions[ACQUISITION_YR])
),
TRUE(), // default case
BLANK()
)
Hi, this didn't work.
When I filter the measure for retained control = 0, it seems that some row instances get caught by the 0 part of the switch statment, and some get caught by the "not hasonevalue" part of the switch statement.
How do i make it so that every single row instances gets caught by the 0 part of the switch statement when I filter for retained control = 0?
Hi @fergu513 ,
Just wanted to check if you had the opportunity to review the suggestion provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You
Hi, it did not work. Still need help
@fergu513 , Try using
DAX
Ext. Sales PY =
VAR SelectedRC = SELECTEDVALUE(Transactions[Retained Control])
VAR Base = CALCULATE(
[03Total_Sales_PY],
Transactions[Whse_Type] = "Branch"
)
RETURN
SWITCH(
TRUE(),
NOT HASONEVALUE(Transactions[Retained Control]),
Base, -- Handle grand total / no filter
SelectedRC = 0,
BLANK(),
SelectedRC = 1,
CALCULATE(
[03Total_Sales_PY],
Transactions[Whse_Type] = "Branch",
Transactions[Retained Control] = 0 ||
Transactions[ACQUISITION_YR] = 0 ||
ISBLANK(Transactions[ACQUISITION_YR])
),
BLANK() -- Default case to handle any unexpected scenarios
)
Proud to be a Super User! |
|
Thanks for the reply.
What is different about this DAX from what I originally posted?
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 4 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 8 | |
| 7 | |
| 6 |