cancel
Showing results for
Did you mean:

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

## CALCULATION OF% BASED ON COLUMN VALUE

Good night people Doubt. Today to make% calculation based on two measures is quiet. Example. Comparing this month with previous month, is quiet. But let's suppose, I'm comparing revenue. When I have in the table, the Profit field, I wanted to make an IF in this%. Example. If the X field equals Profit, divide the costs by the revenue, otherwise, do the normal. I even put something together in the following sense. % Calculation = Var calculus1 = DIVIDE ([Total Value Previous Month], [Actual Total Value], 0) var calculo2 = DIVIDE (calculation1; [03 Net Revenue]; 0) VAR account = SELECTEDVALUE ('DRE Format') = 5 return IF (account; calculo2; calculo1) It returns Zero anyway. Best Regards

1 ACCEPTED SOLUTION

Hi Phil

For example.

I want to do:
[Total Value Previous Month] = Mês Anterior
It's return 726.182 (Lucro Bruto).
Now, the measure is (DIVIDE ([Total Value Previous Month], [Actual Total Value], 0), it's ok.
But, is it possible this scenary?

If the field = Lucro Bruto, so divide (the actual total value about lucro bruto ; the actual total value about Receita Liquida)?
% Calculation =
Var calculus1 = DIVIDE ([Total Value Previous Month], [Actual Total Value], 0)
var calculo2 = DIVIDE (calculation1; [03 Net Revenue]; 0)
VAR account = SELECTEDVALUE ('DRE Format') = 5 return IF (account; calculo2; calculo1)

2 REPLIES 2
Employee

What value does your [Total Value Previous Month] measure return?

Proud to be a Datanaut!

Hi Phil

For example.

I want to do:
[Total Value Previous Month] = Mês Anterior
It's return 726.182 (Lucro Bruto).
Now, the measure is (DIVIDE ([Total Value Previous Month], [Actual Total Value], 0), it's ok.
But, is it possible this scenary?

If the field = Lucro Bruto, so divide (the actual total value about lucro bruto ; the actual total value about Receita Liquida)?
% Calculation =
Var calculus1 = DIVIDE ([Total Value Previous Month], [Actual Total Value], 0)
var calculo2 = DIVIDE (calculation1; [03 Net Revenue]; 0)
VAR account = SELECTEDVALUE ('DRE Format') = 5 return IF (account; calculo2; calculo1)

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors