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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.