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
lcasey
Post Prodigy
Post Prodigy

Calculate % of Revenue

Hello,

 

I have a need to calculate % of revenue .  I tried using the Default % of Grand total , but since there are negative numbers it calculates revenue past 100%

 

Revenue should alsways = 100%  and the percentage should be based on Revenue.

 

How Can I calculate the Percentage of Revenue ?

 

01.jpg

 

 

 

8 REPLIES 8
v-ljerr-msft
Employee
Employee

Hi @lcasey,

 

Could you try using SUMX function(DAX) to calculate the Amount, then use the Default % of Grand total to see if it works? The formula below is for your reference.Smiley Happy

Amount =
SUMX (
    '00-GLSummary',
    IF ( '00-GLSummary'[Revenue] > 0, [Credit] - [Debit], [Debit] - [Credit] )
)

 

Regards

I Tried , but the numbers are now wrong.  The Bottom Line number should

 

 

Using SUMX Incorrect Bottom Line

 

01.jpg

 

 

 

Correct Bottom Line:

 

02.jpg

 

 

 

Sean
Community Champion
Community Champion

@lcasey

 

How about this?

 

% of Revenue =
DIVIDE (
    SUM ( Table[Amount] ),
    CALCULATE (
        SUM ( Table[Amount] ),
        Table[PLTYPE] = "Revenue",
        ALLSELECTED ( Table[PLCategory] )
    ),
    0
)

Or you can try ALL(Table) instead of ALLSELECTED ( Table[PLCategory] )

 

Good Luck! Smiley Happy

There is also no Sum of Amount there are only debits and credits.

 

My Amount must be a measure to make revenue show as a positive number:

 

Amount = IF(SUM('00-GLSummary'[Revenue]) > 0,[Credit] - [Debit],[Debit] - [Credit])

 

Revenue = IF(RELATED('00-COASlicer'[PLTYPE]) = "Revenue" ,1,0)

Sean
Community Champion
Community Champion

How about this? Just substitute the real table name where PLCategory is (I could not see it)

 

% of Revenue =
DIVIDE (
    [Amount],
    CALCULATE (
        [Amount],
        '00-COASlicer'[PLTYPE] = "Revenue",
        ALLSELECTED ( 'Table'[PLCategory] )
    ),
    0
)

I have tried that and there is no errors now, but no calculation either.

 

See Picture:

 

01.jpg

Also,

 

If I  model the % of Revenue as a % then Expenses when filtered show the wrong amount....

 

 

01.jpg

Hello Sean,

 

It doesnt seem to work. I am getting an Incorrect Syntax error.

 

Maybee its the relationship?

 

01.jpg

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.