Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
maurcoll
Helper III
Helper III

help with text box including measures

Hi

 

I have the following measure which doesnt quite do what i need it to

Text Box = "In the last 12 months " & SELECTEDVALUE ([country]) & " is " &[change]& " with a difference of "& FORMAT([Change % - Date], "#,#%") & " compared to the previous 12 months"

 

I need to say if nothing is selected then All Countries but if one is selected then the selected value and also the format for the percentage is rounding i need it to be 2 decimal places 1.50% not 2% or -1.50% not -2%

 

Thank you

1 ACCEPTED SOLUTION
GeraldGEmerick
Solution Supplier
Solution Supplier

@maurcoll Try the following:

Text Box = 
VAR _Country = IF( HASONEVALUE( 'Table'[country] ), SELECTEDVALUE( [country] ), "All countries" )
VAR _IsAre = IF( HASONEVALUE( 'Table'[country] ), "is", "are" )
VAR _Format = "0.00%;-0.00%;0.00%"
VAR _Return = "In the last 12 months " & _Country & _IsAre &[change]& " with a difference of "& FORMAT([Change % - Date], _Format) & " compared to the previous 12 months"
RETURN _Return

View solution in original post

2 REPLIES 2
maurcoll
Helper III
Helper III

That works perfectly thank you

 

GeraldGEmerick
Solution Supplier
Solution Supplier

@maurcoll Try the following:

Text Box = 
VAR _Country = IF( HASONEVALUE( 'Table'[country] ), SELECTEDVALUE( [country] ), "All countries" )
VAR _IsAre = IF( HASONEVALUE( 'Table'[country] ), "is", "are" )
VAR _Format = "0.00%;-0.00%;0.00%"
VAR _Return = "In the last 12 months " & _Country & _IsAre &[change]& " with a difference of "& FORMAT([Change % - Date], _Format) & " compared to the previous 12 months"
RETURN _Return

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors