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
Chanleakna123
Post Prodigy
Post Prodigy

Can't Remove Decimals in some field Because the Formula are Mutual Using

hi All , 

1 : when i select NSR/UC , I wanna show 2 Decimals . When i change to select NSR or UC or Transaction , it shows the whole number ( No Decimals at All ) , 

NSR/UC : is coming from NSR and UC , therefore if i remove the 2 Decimals , it will remove until NSR/UC which is not what i want. how can i acheive this ? 

 

1.PNG

1 ACCEPTED SOLUTION

Hi @Chanleakna123 ,

 

You can add the FORMAT function before your measure.

We create a sample you can refer.

 

RE = 
var _select = SELECTEDVALUE('Table (2)'[Column1])
return
SWITCH(
    TRUE(),
    _select="A",FORMAT([max],".0"),
    _select="B",FORMAT([min],".00"),
    _select="C",FORMAT([sum],".000"),
    _select="D",FORMAT([average],".0000"))

 

can1.jpg

 

can2.jpg

If it doesn't meet your requirement, could you please show the exact expected result based on the pbix that we have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

View solution in original post

14 REPLIES 14
v-zhenbw-msft
Community Support
Community Support

Hi @Chanleakna123 ,

 

How about the result after you follow the suggestions mentioned in my original post?

Could you please provide more details or expected result about it If it doesn't meet your requirement?

If you've fixed the issue on your own please kindly share your solution.

If the above posts help, please kindly mark it as a solution to help others find it more quickly. Thanks!

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-zhenbw-msft
Community Support
Community Support

Hi @Chanleakna123 ,

 

Do you want to change the decimal number of the value by selecting the slicer, but do not change the value?

Does @Tahreem24 's solution work for you?

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply?

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-zhenbw-msft  , 

 

his answers : 

Measure = 
Var P = SELECTEDVALUE(Table'[TypeColumn])
Return IF(P="NSR/UC", FORMAT(SUM('Table'[SalesColumn]),"############.00"),FORMAT(SUM('Table'[SalesColumn]),"##########"))
 
but i have no idea which sales columns i should choose , because NSR and other transaction are in different tables . which tables i should select ? 

I am using Slicer Measure : therefore , when i filter , the number will be applied based on what i filter . 
but those tables , are not in one , NSR and UC and Transaction , etc... are in different tables. 
not sure how to acheive this 😞
thx you 
 

Hi @Chanleakna123 ,

 

Sorry for that we have a little confused, what is a measure slicer?

Does the slicer create with measure? Or is the name of some customer visuals?

 

Could you please provide some fake data? Let us better understand your measure logic and business logic.

This is also helpful for others to understand your issue.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-zhenbw-msft   , it looks like this. 

the reason i am using this , because i want to use slicer to be filtered . 

but the thing is the number of NSR/UC needs to be in 2 decimals behind. 

while others i dun want to have the decimals 

PS : all the Tables are different tables 

1.PNG

Hi @Chanleakna123 ,

 

You can add the FORMAT function before your measure.

We create a sample you can refer.

 

RE = 
var _select = SELECTEDVALUE('Table (2)'[Column1])
return
SWITCH(
    TRUE(),
    _select="A",FORMAT([max],".0"),
    _select="B",FORMAT([min],".00"),
    _select="C",FORMAT([sum],".000"),
    _select="D",FORMAT([average],".0000"))

 

can1.jpg

 

can2.jpg

If it doesn't meet your requirement, could you please show the exact expected result based on the pbix that we have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

woww , @v-zhenbw-msft  , i think i have acheived this. one more thing , can i put ( , ) as well ? 😄

For Example : 3,528169.0000   , right now is 3518169.000

 

 1.PNG

Hi @Chanleakna123 ,

 

You can try this Measure,

 

RE = 
var _select = SELECTEDVALUE('Table (2)'[Column1])
return
SWITCH(
    TRUE(),
    _select="A",FORMAT([max],"###,###.0"),
    _select="B",FORMAT([min],"###,###.00"),
    _select="C",FORMAT([sum],"###,###.000"),
    _select="D",FORMAT([average],"###,###.0000"))

 

can1.jpg

 

Or you can configure this in each Measure.

 

can2.jpg

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-zhenbw-msft  , i can not do Asc and Des with all these measures. 

Do we have way ? 

 

Hi @Chanleakna123 ,

 

If you want to sort the measures on the Slicer, you need to add a sort column and sort by this column.

 

c1.jpg

 

c2.jpg

 

If it doesn't meet your requirement, could you tell use the expected results you want to sort?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tahreem24
Super User
Super User

@Chanleakna123 ,

Try the below Measure:

Measure = 
Var P = SELECTEDVALUE(Table'[TypeColumn])
Return IF(P="NSR/UC", FORMAT(SUM('Table'[SalesColumn]),"############.00"),FORMAT(SUM('Table'[SalesColumn]),"##########"))
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24 I am using measure slicer . Is it possible to do so ? 

amitchandak
Super User
Super User

@Chanleakna123 , if you are using measure slicer, formatting will be an issue. Is it a measure slicer ?

@amitchandak  Yes I am using measure slicer 

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.