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 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
The below calculation is returning all "Retained" values, is there something obvious you can see that's making that happen? The second IF statement should be like an ELSEIF, but PBI doesn't like that.
Solved! Go to Solution.
Hi @PBrainNWH
To expand on @aduguid 's measure, for debugging it might be easier like the following. If you aren't getting the correct result, you can always RETURN either of the variables for debugging.
FY25 Status 1 =
VAR _2024 = SUM( 'Donations by Customer by FY'[2024 Donation Dollars] )
VAR _2025 = SUM( 'Donations by Customer by FY'[2025 Donation Dollars] )
VAR _Logic =
IF(
_2024 <> 0
&& _2025 <> 0,
"Retained",
IF(
_2024 = 0
&& _2025 <> 0,
"New425",
IF(
_2024 <> 0
&& _2025 = 0,
"Lapsed",
BLANK()
)
)
)
RETURN
_Logic
I hope this helps.
Hi @PBrainNWH
To expand on @aduguid 's measure, for debugging it might be easier like the following. If you aren't getting the correct result, you can always RETURN either of the variables for debugging.
FY25 Status 1 =
VAR _2024 = SUM( 'Donations by Customer by FY'[2024 Donation Dollars] )
VAR _2025 = SUM( 'Donations by Customer by FY'[2025 Donation Dollars] )
VAR _Logic =
IF(
_2024 <> 0
&& _2025 <> 0,
"Retained",
IF(
_2024 = 0
&& _2025 <> 0,
"New425",
IF(
_2024 <> 0
&& _2025 = 0,
"Lapsed",
BLANK()
)
)
)
RETURN
_Logic
I hope this helps.
Try this measure
FY25 Status =
IF (
SUM('Donations by Customer by FY'[2024 Donation Dollars]) <> 0
&& SUM('Donations by Customer by FY'[2025 Donation Dollars]) <> 0,
"Retained",
IF (
SUM('Donations by Customer by FY'[2024 Donation Dollars]) = 0
&& SUM('Donations by Customer by FY'[2025 Donation Dollars]) <> 0,
"New425",
IF (
SUM('Donations by Customer by FY'[2024 Donation Dollars]) <> 0
&& SUM('Donations by Customer by FY'[2025 Donation Dollars]) = 0,
"Lapsed",
BLANK() -- This will handle any unexpected cases
)
)
)
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 |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 23 |