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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
jay_patel
Helper IV
Helper IV

How to convert a specific measure to decimal consist in another measure

Hello All,
 Is it possible, to convert decimal places to 2 for specific measure. below is my dax:

DI_Value = SWITCH(TRUE(),
SELECTEDVALUE('Attribute'[Attribute])="OHI > 12 Months",IF([on Hand Inv(Greater than 12 month)]=BLANK(),0,[on Hand Inv(Greater than 12 month)]),
SELECTEDVALUE('Attribute'[Attribute])="In-Transit (docs recvd)",IF([nopendelStock measure]=BLANK(),0,[nopendelStock measure]),
SELECTEDVALUE('Attribute'[Attribute])="OHI (>12 Months + In-Transit)",IF([On Hand (Greater Than 12 m) + In-Transit (docs rec'd)]=BLANK(),0,[On Hand (Greater Than 12 m) + In-Transit (docs rec'd)]),
SELECTEDVALUE('Attribute'[Attribute])="Coverage-OH+InTransit/3 mnth frcst Avg",IF([Coverage -OH+In Tranit / 3mth Fcst Avg]=BLANK(),0,[Coverage -OH+In Tranit / 3mth Fcst Avg]),
SELECTEDVALUE(Attribute[Attribute])="Monhtly Forcst- Currnt Month",IF([Monthly Forecast (Current Month)]=BLANK(),0,[Monthly Forecast (Current Month)]),
SELECTEDVALUE(Attribute[Attribute])="MTD Orders (Date-1)",IF([MTD qty measure]=BLANK(),0,[MTD qty measure]),
SELECTEDVALUE(Attribute[Attribute])= "MTD Shippments (Date-1)",IF([MTD Sales measure]=BLANK(),0,[MTD Sales measure]),
SELECTEDVALUE(Attribute[Attribute])="BackOrder Qty Net Off Stocks",IF([Backorder Qty (net off stocks)]=BLANK(),0,[Backorder Qty (net off stocks)]),
SELECTEDVALUE(Attribute[Attribute])="Customer Backorder $$",IF([Customer Backorder $$]=BLANK(),0,[Customer Backorder $$]),
SELECTEDVALUE(Attribute[Attribute])="Monthly Forecast (3 mon Avg)",IF([Monthly Forecast (3 mo Average)]=BLANK(),0,[Monthly Forecast (3 mo Average)]),
SELECTEDVALUE(Attribute[Attribute])="Total Commits (Curr Mon)",IF([Total Commits (Current Month)]=BLANK(),0,[Total Commits (Current Month)]),
SELECTEDVALUE(Attribute[Attribute])="Total Commits M1",IF([Total Commits (M1)]=BLANK(),0,[Total Commits (M1)]),
SELECTEDVALUE(Attribute[Attribute])="Deliveries to Eversena (Curr Mon)",IF([Deliveries to Eversana (Current Month)]=BLANK(),0,[Deliveries to Eversana (Current Month)]),
SELECTEDVALUE(Attribute[Attribute])="Last 12 Month Average Shipment",IF([Last 12 month average shipment]=BLANK(),0,[Last 12 month average shipment]),
SELECTEDVALUE(Attribute[Attribute])="Last 12 Month Average Order",IF([Last 12 month average order]=BLANK(),0,[Last 12 month average order]),
SELECTEDVALUE(Attribute[Attribute])="FI Stock ( Not in BSR)",IF([nopenFIStock measure]=BLANK(),0,[nopenFIStock measure]))

where above measure's decimal places is 0, and if convert it to 2 then it will convert it for all measures it have in dax.
but i want to convert decimal place for specific measure only, highlighted with Bold.

below is the graph i created using above measure.

inventory.png

where client only want decimal for bar 'Coverage-mnth frcst Average'.

Thanks in advance for your efforts.


5 REPLIES 5
AlanP514
Helper V
Helper V

Hi @jay_patel 

Use format dax for that sepcific Bar 

Yes I did the same, still not visible

Hi @jay_patel 

Can you share the PBIX file after avoiding sensitive data

miTutorials
Super User
Super User

Format your Measure explicity by using the Format function. Please see the code below. You can remove the decimal values if you need a whole number.

 

DI_Value = Format([Your BoldMeasure],"0.00")

  

HI @miTutorials 

Now the bar is not visible for bold measure.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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