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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. 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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.