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
HR30385
New Member

Unable to format Field Parameters as Number

Hi there, 

 

I have a field parameter that let's users select between "net" and "gross" values: 

Parameter Local Currency Gross Net = {
    ("Gross Total LC", NAMEOF('SnapImpactDistributionObjs'[Impact Gross Total LC monthly]), 0),
    ("Net Total LC", NAMEOF('SnapImpactDistributionObjs'[Impact Net Total LC monthly]), 1)
}

The parameter is formatted as text and shows values:

Screenshot 2024-03-24 184537.png

When I change the formatting to any numbers format it gives me an error saying: "Gross Total LC" can not be converted into type integer while the column "Parameter Local Currency Gross Net" is compiled.

The underlying column "Impact Gross Total LC monthly" is a numbers column. 

Does anybody know how to fix this? 

Thanks!
1 ACCEPTED SOLUTION
vicky_
Super User
Super User

The "Parameter Local Currency Gross Net" that you're trying to convert to an Int actually refers to a table. When you create a field parameter, you're actually creating a table of sorts (notice how the part after the equals is "{")

 

If you need to convert any of the actual results you see in your visuals to an integer, you need to format the original measures (i.e SnapImpactDistributionObjs'[Impact Gross Total LC monthly] and SnapImpactDistributionObjs'[Impact Net Total LC monthly])

View solution in original post

2 REPLIES 2
vicky_
Super User
Super User

The "Parameter Local Currency Gross Net" that you're trying to convert to an Int actually refers to a table. When you create a field parameter, you're actually creating a table of sorts (notice how the part after the equals is "{")

 

If you need to convert any of the actual results you see in your visuals to an integer, you need to format the original measures (i.e SnapImpactDistributionObjs'[Impact Gross Total LC monthly] and SnapImpactDistributionObjs'[Impact Net Total LC monthly])
HR303
Frequent Visitor

Great. Thanks for the answer.

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.