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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Amz_123
Helper I
Helper I

Decimal Point Control by using DAX.

Hi Community,
I am struck at contolling the decimal point adjustment.

I am having Filter with Sales and % Share. In Treemap Visual, I am visualing a measure[Value based on Selection] based on filter selection. My problem here is, When Sales is selected, [Value based on Selection] must display value in whole number and when % Share is selected, [Value based on Selection] must dispaly value with one decimal point. For reference I am attaching sample pbix file.
PBIX FILE Link:
https://drive.google.com/file/d/1RPLspEgLhBHvDVInb7lOc-5Ytf-kclsi/view?usp=sharing
Example:
Sales is selected,[Value based on Selection] = 789
% Share is selected,[Value based on Selection] = 45.4

Thanks in advance,
With regards,

Amz

 

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @Amz_123 

 

Based on your description, you may create two measures as follows and put them in the Treemap visual.

 

Value Based Selectio Units = if(SELECTEDVALUE(Selection[Selection])="Units",int([Total Units]),0)

Value Based Selectio % Share = if(SELECTEDVALUE(Selection[Selection])="% Share",[% Share]*100)

 

 

Result:

b1.png

b2.png

 

Best Regards

Allan

 

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

Hi @v-alq-msft 
Thanks for your reply. The solution which you have given doesnot seems to work. Please provide if any other idea you have.
Thanks in Advance.
Amz

Hi, @Amz_123 

 

Could you please show me your error message? Based on my tests, It is a relatively good workaround for a tree map visual.

 

Best Regards

Allan

Hi @v-alq-msft ,

I want resultant values to be in single measure, when I select units then value displayed in tree visual should not have decimal point. When I select % Share then value displayed in tree visual should have 1 decimal point. I cannot use 2 measures for every single visuals because there are lots of visuals to show data similarities for Units and % Share.Please Guide.

Thanks in Advance
Amz

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.