Skip to main content
cancel
Showing results for 
Search instead 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

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
Microsoft Employee
Microsoft 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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.