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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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