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
HillUser1
Frequent Visitor

Data Conversion (Number to Currency) not applying inside measure.

Inside my report, the user uses a slicer to narrow down to a single specific project. It will then show data related to a single project and evaluate the project status based on a couple of indicators. It appears that when I try to report a number with the SELECTEDVALUE command I do not receive any previous formatting I made in the modeling tab. When I also try to manually apply a conversion inside the DAX I do not get the expected results. The SELECTEDVALUE remains a number. ROUND command works.

 

What is the proper way to perform this action?

 

Current Result: Billing was $2229.50 over the actual cost for the past 2 months.

Expected Result: Billing was $$2,229.50 over the actual cost for the past 2 months.

 

Current DAX Formula:

 

Measure 1 = 

SWITCH(TRUE(),
ISBLANK(SELECTEDVALUE(V_PBI_HMC_JOB_PROJECTION_DATA[LogicSegment11_0])),"Calculation Error",
SELECTEDVALUE(V_PBI_HMC_JOB_PROJECTION_DATA[LogicSegment11_0])>0,"Billing was $" & CURRENCY(SELECTEDVALUE(V_PBI_HMC_JOB_PROJECTION_DATA[LogicSegment11_0])) & " over the actual cost for the past 2 months",
SELECTEDVALUE(V_PBI_HMC_JOB_PROJECTION_DATA[LogicSegment11_0])<0,"Billing was $" & (ROUND(SELECTEDVALUE(V_PBI_HMC_JOB_PROJECTION_DATA[LogicSegment11_0])*-1,0)) & " under the actual cost for the past 2 months")
1 ACCEPTED SOLUTION
AilleryO
Memorable Member
Memorable Member

Hi,

 

Instead of your CURRENCY function, did you try with a FORMAT function ?

FORMAT(myvalue,"$ #,###.00")

 

Tell us if it works...

 

Have a nice day

View solution in original post

2 REPLIES 2
AilleryO
Memorable Member
Memorable Member

Hi,

 

Instead of your CURRENCY function, did you try with a FORMAT function ?

FORMAT(myvalue,"$ #,###.00")

 

Tell us if it works...

 

Have a nice day

Thank you for your help. It worked and is exactly what I needed. 

 

For Additional information and Options on the format fucntion: 

 

Other use: FORMAT( 12345.67, "Currency")

Linkhttps://docs.microsoft.com/en-us/dax/pre-defined-numeric-formats-for-the-format-function

 

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.

Top Solution Authors