This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi,
I have the following measure, which creates a natural sentence, which I then put on a hover page, to show up when a user hovers over the individual bars of a barchart.
Overview_hover_txt =
var TvsP = IF(SELECTEDVALUE(Overview_MostRecentYR[Diagnoses]) = SELECTEDVALUE(Overview_MostRecentYR[PersonsWithDx]),
"",
" ("&&format(SELECTEDVALUE(Overview_MostRecentYR[Diagnoses]), "#,#")&" tumours)"
)
RETURN
"In "&max(Overview_MostRecentYR[year])&", "&format(sum(Overview_MostRecentYR[PersonsWithDx]), "#,#")&" Victorians were diagnosed with "&SELECTEDVALUE(TumourGrouping[SumPage_LvL1_label], "cancer")&TvsP&". Our most recent data shows that 5-year survival is "&format(sum(Overview_MostRecentYR[Survival]), "#.#%")&" (95% confidence interval "&format(SELECTEDVALUE(Overview_MostRecentYR[Survival_LL]), "#.#%")&"-"&format(SELECTEDVALUE(Overview_MostRecentYR[Survival_LL]), "#.#%")&" for the period "&SELECTEDVALUE(Overview_MostRecentYR[Period])&"). In "&max(Overview_MostRecentYR[year])&", "&format(sum(Overview_MostRecentYR[Deaths]), "#,#")&" Victorians died from "&SELECTEDVALUE(TumourGrouping[SumPage_LvL1_label], "cancer")&"."
It works where the condition is met (i.e. the IF statement returns ""):
, but I get an error when the condition is not met. The error is:
What can I do to let the if statement return
Solved! Go to Solution.
@LucMarv
Need to unders why "&&" in the below line (Value for False Condition) . I think this is causing problem
("&&format(SELECTEDVALUE(Overview_MostRecentYR[Diagnoses]), "#,#")&" tumours)
Proud to be a Super User!
Yep that was it! Too bad PowerBI does not give an informative error message when this happens!
Thanks for taking the time to help me! Much appreciated!
@LucMarv
Need to unders why "&&" in the below line (Value for False Condition) . I think this is causing problem
("&&format(SELECTEDVALUE(Overview_MostRecentYR[Diagnoses]), "#,#")&" tumours)
Proud to be a Super User!
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 25 | |
| 21 | |
| 18 | |
| 17 |
| User | Count |
|---|---|
| 62 | |
| 34 | |
| 33 | |
| 25 | |
| 24 |