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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Microsoft Employee
Microsoft 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.