cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper IV

## How to create measure that selects what value to use as the denominator in Divide.

I fixed it in one of the reference measures.   Never did figure out how to select a variable to use in a expression like divide.

I am trying to create a measure where the denominator changes based on the shared axis value.

I need to change the Denominator depending on what is being Calculated.

I have tried IF statements, but will not allow me to use the Table column or measures that show the value to be used as the Logic test.

I know the below code is not all correct, but it should get the question across.

i.e.

TotalSalesRatio =

Var Totalsalespeople = [AllSalesPeople]
Var TotalsalesoneSalesperson = [SalesPerson]
Var DesiredReportSales = ""

If([DesiredReport]="all",
AllSalesPeople,
TotalsalesoneSalespPerson)

Divide([TotalSales],DesiredReportSales,0)

1 ACCEPTED SOLUTION
Helper IV

I fixed it in one of the reference measures.   Never did figure out how to select a variable to use in a expression like divide.

I added a filter in one of the reference measures so that the data sent to the divide calculation had the required information.

4 REPLIES 4
Helper IV

I fixed it in one of the reference measures.   Never did figure out how to select a variable to use in a expression like divide.

I added a filter in one of the reference measures so that the data sent to the divide calculation had the required information.

Helper IV

What I need to be returned by the measure.  I have highlighted the number that I need to be able to select via an if statement or someother command.

 Total Power(input) Peak Power(Input) Ratio (output) Area1 5531.68 9812.91 56.37% Area2 819.26 1211.00 68%

What I am getting returned by the measure

 Total Power(input) Peak Power(input) Ratio(output) Area1 5531.68 9812.91 56.37% Area2 819.26 3459.02 23.68%
Helper IV

I have a Visual that needs to be different during the week than it is on weekends.  During the week, the measure is based on a weekly peak of a subset of equipment.  On the weekends it is the Peak of all the equipment.

I need to figure out how to calculate the Ratio for the total power used divided by both the "Weekly Peak of subset of equipment" and "Peak of all the equipment", one at a time.

This visual needs to have the ratio for total Power used divided by  both the Subset and all calculated values.

Super User

Hi @moltra ,

Your query is not making any sense. The only thing I understand here is you want to use DIVIDE function in DAX but you are not able to use it.

Add some sample data and expected output to show what your actual requirement is.

Thanks,

Pragati

Best Regards,

Pragati Jain

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Proud to be a Super User!!