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
igorabdo
Advocate II
Advocate II

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.Screenshot_3.png

 

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)

 

 

View solution in original post

2 REPLIES 2
Phil_Seamark
Employee
Employee

HI @igorabdo

 

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


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi Phil

For example.Screenshot_3.png

 

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)

 

 

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.