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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
xuri
Frequent Visitor

Multiple use of the same calculation formula as a function for measures?

Hello,

I have a formula, which I want to use for multiple parameters. Defining the formula as a measure and using a filter for the parameters is not possible due to the data structure and an outer join. I have already tried this approach, but with a filter, I get the wrong values for the calculation. I only get the correct values, if I define the filters in separated measures for every parameter. Let's assume that the formula is
GetResult = (PARAMETER_2) / (PARAMETER_1 - PARAMETER_2)



What I have to do is:
Measure1 = (PARAMETER_2_Type1) / (PARAMETER_1_Type1 - PARAMETER_2_Type1)
Measure2 = (PARAMETER_2_Type2) / (PARAMETER_1_Type2 - PARAMETER_2_Type2)
Measure3 = (PARAMETER_2_Type3) / (PARAMETER_1_Type3 - PARAMETER_2_Type3)
etc.


Would it be possible to create a function which can be used for measures? I was thinking about defining a formula, which encapsulates the formula above into something like this: 
GetResult(PARAMETER_1_Type, PARAMETER_2)

This will not reduce the amount of measures, which I have to create, but I do not have to retype the whole formula x-times and it will reduce the risk of entering a wrong value in the formula. Is there a way to achieve this or is it only possible to copy the whole written-out formula and change the parameters?

Any hints and suggestions will be appreciated!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@xuri,

The functionality that create custom DAX function is not supported in Power BI Desktop. An idea about this issue has been submitted in this link, please vote it up.


You would need to copy the whole written-out formula and change the parameters.

Regards,
Lydia

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@xuri,

The functionality that create custom DAX function is not supported in Power BI Desktop. An idea about this issue has been submitted in this link, please vote it up.


You would need to copy the whole written-out formula and change the parameters.

Regards,
Lydia

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors