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
Anonymous
Not applicable

how to get decimal for 1 row only

Hi Everyone,

 

I have a data table that looks like this:

toyoman62_1-1611771353632.png

 

The data table name is "Region Sales" and the column headers are as shown above.

I want to show this as a table visual exactly like this where the second row "% of Sales" is a decimal while the first row is a whole number.

 

Is there a way to do this?  Thank you!

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

In addition to  

Logic of IF in Dax: IF(<logical_test>, <value_if_true>[, <value_if_false>])

Measure = 
if(max('Table'[Category]) = "% of Sales", format(MAX('Table'[Value]), "#,###.#"),Format(MAX('Table'[Value]), "#,###"))

My Sample:

2.png

Result is as below:

3.png

Best Regards,

Rico Zhou

 

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

 

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

In addition to  

Logic of IF in Dax: IF(<logical_test>, <value_if_true>[, <value_if_false>])

Measure = 
if(max('Table'[Category]) = "% of Sales", format(MAX('Table'[Value]), "#,###.#"),Format(MAX('Table'[Value]), "#,###"))

My Sample:

2.png

Result is as below:

3.png

Best Regards,

Rico Zhou

 

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

 

amitchandak
Super User
Super User

@Anonymous , You can try something like this if category is row

if(max(Table[categorty]) = "Sales unit Cost", format([value], "#,###"), format([value], "#,###.#"))

 

Please correct the format as per need.

 

or if these are two measures, then you can use a matrix with "Show on row". each measure can have its own format.

Anonymous
Not applicable

Hi @amitchandak ,

So overall, your solution worked!  I'll be sure to click on the "accept as solution" button. But before I do, I have one more question. When I used your function, it correctly shows the line I want as a decimla while keep the other 2 lines as a while number, however, as you can see below, there is still a period at the end of 12,189 & 1,000.  Is there a way to get rid of that period?  I tried playing around with your function with no luck.

 

toyoman62_0-1611859564908.png

 

 

Thanks!!

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.