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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

help to calculate sales for each product

hi i am new to power bi and Dax , i need a little help i have a table with rents of different Properties .Structure of table is as follows :

Properties :

PropertyID |   RentPerMonth |   Month(date)  

----------------------------------
i want to see total revnue for each property ID

eg if  i have 2 properties eg 

prp1  |200 | July 2009
prp1  |300  | August 2009
prp1  |250  | september 2009
prp2  |215 | July 2009
prp2  |275  | August 2009
prp2 |288 | september 2009

now for each  property id  i want to see its total revnue generated ,secocdaly i want to see standard deviation against each property id

 

Note : I dont want to total sales  for all products , i want to see sales for each product ID so i can see them on any visual


 



 

1 ACCEPTED SOLUTION

You send me the formula for standard deviation so I rebuild it in DAX for you so you can understand it. If you check the formula you posted, you will see -1 too.

 

You can find the full explanation of ALLEXCEPT here;

https://docs.microsoft.com/en-us/dax/allexcept-function-dax

 

View solution in original post

19 REPLIES 19
Anonymous
Not applicable

2019-06-19_21h45_18.png

 

 

 

 

 

 

 

 

 

 

 

 

 

I hope this is what your after:

Stdev (In Property) = CALCULATE(STDEV.S(Table1[Value]),ALLEXCEPT('Table1',Table1[Property]))
Avg (In Property) = CALCULATE(AVERAGE('Table1'[Value]),ALLEXCEPT('Table1',Table1[Property]))

 

parry2k
Super User
Super User

@Anonymous in your post what you refer to product?? It is not very clear?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

By product I mean property

I want to see total sales and standard deviation for each unique property
avanderschilden
Resolver I
Resolver I

Hello,

 

Create a simple measure like SUM(RentPerMonth), drag the measure into a column chart, and drag property id on the axis.

 

Regards,

Adrian

Anonymous
Not applicable

And same for standard deviation?

Use it's dax formula ?

What do you think about this?

 

Capture.PNG

Anonymous
Not applicable

StandardDev = STDEV.P('fiverr_db monthly_mar_19'[RevenueUSD])

i used this is it fine??

I can not confirm that, because it produces a weird result in my data set;

 

Capture.PNG

Anonymous
Not applicable

same here confused...

and standard deviation formula is way complex

image.png

I'm glad I could help

Anonymous
Not applicable

so what you suggest ? need your suggestion

Here you go;

 

Capture.PNG

Anonymous
Not applicable

can you please share formulas for delta AND  squared delta and all calculation you did 🙂

i want to try with my data 🙂

Total Rent =
SUM('Property'[Rent])
 
Average Rent =
CALCULATE(AVERAGE('Property'[Rent]),ALL('Property'))
 
Delta =
[Total Rent]-[Average Rent]
 
Squared Delta =
[Delta]*[Delta]
 
St Dev =
SQRT(DIVIDE([Squared Delta],CALCULATE(COUNTROWS('Property'),ALL('Property'))-1))
Anonymous
Not applicable

just a random thought average of rent will be giving average of all rents for all property ids. right?

its not showing average  rent for each property am i right?

That's correct. As you can see in the screenshots the average is equal on all rows.

 

If you want to use the average of a property you can change the measure into;

 

Capture.PNG

 

And also change the St Dev measure into;

 
SQRT(DIVIDE([Squared Delta],CALCULATE(COUNTROWS('Property'),ALLEXCEPT('Property','Property'[Property]))-1))
Anonymous
Not applicable

and just for sake of understanding...what is the use of this allexcept and that subtraction(-1) in end

what that subtraction do..

Sorry for asking so many lame questions , Actually i am new to power bi and dax and i want to polish my skills in this field

You send me the formula for standard deviation so I rebuild it in DAX for you so you can understand it. If you check the formula you posted, you will see -1 too.

 

You can find the full explanation of ALLEXCEPT here;

https://docs.microsoft.com/en-us/dax/allexcept-function-dax

 

Anonymous
Not applicable

and*(Total rent ) sum will be changed in similar manner to show sum for each proerty ,rather then showing for all

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.