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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ThomasDay
Impactful Individual
Impactful Individual

Format numeric field--am losing slicer context

Hello all,

 

I'm stumped.  I've gone around and around on formatting a tel. number field and am seeing some really unpredictable context changes.  I create a measure...it is a text data type.

 

 

HospicePhone = 
VAR PhoneNumber = LOOKUPVALUE(HospiceProfiles[Telephone Number], HospiceProfiles[CCN],
FIRSTNONBLANK(MergedProviders[CCN],MergedProviders[CCN]))
RETURN
PhoneNumber

The results in a table look fine and so now I want to format the text version of the phone.  Notice that all the entries are in AR, set by a slicer.  So now it's time to format it...

2017-09-11_20-51-12.png2017-09-11_21-01-29.png

HospicePhone = 
VAR PhoneNumber = LOOKUPVALUE(HospiceProfiles[Telephone Number], HospiceProfiles[CCN],
FIRSTNONBLANK(MergedProviders[CCN],MergedProviders[CCN]))
VAR PhoneToFormat = FORMAT(VALUE(PhoneNumber),"\(000\)000\-0000")
RETURN
PhoneToFormat

So I've tried a zillion versions of things to format:  Here's one and it fails.  Notice how the table NOW includes FL...And the phone is blank for all but the slicer state of AR.  I can filter the visual to eliminate blanks...all looks fine, but what the heck is going on?  Not to mention, if a provider doesn't have a phone number, the filter will eliminate that row...so it's not ideal.  

2017-09-11_20-49-18.png

 

 

 

 Why does adding a format change the slicer context?  Hope this is clear enough to figure out what I'm asking and thanks in advance, Tom

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@ThomasDay,

I am not able to reproduce your issue when using the above formula to format the measure in my sample table, could you please share me the data in your MergedProviders table and HospiceProfiles table so that I can test?

1.JPG

Regards,

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.