Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I have the following formula and I can't figure out how to make the blanks appear as zero "0".
Formula:
Solved! Go to Solution.
1.Q2 =
VAR Result =
SWITCH (
'Testing'[0.ACQuarters],
"Q1 2025", "Q2 2025",
"Q2 2025", "Q2 2025"
)
RETURN
IF ( ISBLANK ( Result ), "0", Result )
Set Data type = Text
1.Q2 =
VAR Result =
SWITCH (
'Testing'[0.ACQuarters],
"Q1 2025", "Q2 2025",
"Q2 2025", "Q2 2025"
)
RETURN
IF ( ISBLANK ( Result ), "0", Result )
Set Data type = Text
Thank you. This works.
Hi @DMB90
The following dax measure should help you
Q2 =
COALESCE(
SWITCH(
'Testing'[0.ACQuarters],
"Q1 2025", "Q2 2025",
"Q2 2025", "Q2 2025"
),
0)
If you are using numerical field, replace the COALESCE() by a +0
I now received the message "Expressions that yield variant data-type cannot be used to define calculated columns"
What should the Data Type be?
this will be valid for a calculated column to keep everything as text.
Q2 =
COALESCE(
SWITCH(
'Testing'[0.ACQuarters],
"Q1 2025", "Q2 2025",
"Q2 2025", "Q2 2025",
BLANK()
),
"0"
)
I now received the message "Expressions that yield variant data-type cannot be used to define calculated columns"
What should the Data Type be?
Sorry, when I type the formula, I forgot the ""
Because you are working with textual value, and 0 is a numerical value, we have to convert it into string:
Q2 =
COALESCE(
SWITCH(
'Testing'[0.ACQuarters],
"Q1 2025", "Q2 2025",
"Q2 2025", "Q2 2025"
),
"0")
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 49 | |
| 35 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 91 | |
| 75 | |
| 41 | |
| 26 | |
| 25 |