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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
violet11_6
Regular Visitor

Percentage of Revenue

Hi,


Any kind soul there who could help me? I am trying to get TotalRevenue to appear on every PnL account on my PnL Statement as follows:

Account NameValueTotal Revenue
Revenue1,0001,000
Cost of Sales4001,000
SG&A3001,000


I have used the following formula:

TtlRevenue = 
VAR Revenue = CALCULATE(SUM('PnL Database'[Value], Filter('PnLDatabase','PnL Database'[AccountName]="Revenue"))
RETURN CALCULATE(Revenue, ALL('PnL Database'[AccountName]))

and my table looks like this:

YearCurrencyEntityAccountNameValue
   Revenue 
   Cost of Sales 
   SG&A 


However, I get the following results instead. The TotalRevenue does not appear against every account line.

Account NameValueTotal Revenue
Revenue1,0001,000
Cost of Sales400 
SG&A300 


My ultimate aim, as you can guess, is to work out the AccountNameValue as a Percentage of my TotalRevenue.

Any advice? Thanks in advance for your help.

1 ACCEPTED SOLUTION

Hi,

 

Thank you. I managed to solve it with the ALL filter. I suppose I was pulling data from the incorrect database.

Thanks

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@violet11_6 , Try like

CALCULATE(SUM('PnL Database'[Value], 'PnL Database'[AccountName]="Revenue")

 

or

 

CALCULATE(SUM('PnL Database'[Value], Filter(allselected('PnLDatabase'),'PnL Database'[AccountName]="Revenue"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi,

 

Thank you. I managed to solve it with the ALL filter. I suppose I was pulling data from the incorrect database.

Thanks

Can you share the updated DAX expression? I have this same problem

Helpful resources

Announcements
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!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.