Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi I have a measure that calculates TotalProducts and I would like to now calculate Average([TotalProducts]) based on Region column. Can someone please help on how to get this. Please see below measure calculation
Solved! Go to Solution.
@Anonymous
Should be the same way. I am not sure if below coding can meet your requirement. You can try this.
average = Divide(calculate(Regioncount,all(table)),Regioncount)
Proud to be a Super User!
@Anonymous,
Based on your description, formula TotalProducts is the formula below you have posted, right?
TotalProducts =
CALCULATE (
CALCULATE (
DISTINCTCOUNT ( 'Product'[ProductNumber] ),
FILTER ( 'Product', ISBLANK ( 'Product'[Modified Date] ) = FALSE () ),
USERELATIONSHIP ( DateTable[Date], 'Product'[Created Date] )
)
+ 0
)
If the formula is measure, change it into calculate column and try again.
Regards,
Jimmy Tao
Thanks for your reply. I would like try using measures rather than custom column. This is what I need.
| Contact_address1_city | RegionCount | Average | Calc |
| NULL | 5535 | 2.312195 | =12798/5535 |
| London | 1252 | 10.22204 | =12798/1252 |
| HIGH WYCOMBE | 554 | 23.10108 | =12798/554 |
| GLASGOW | 619 | 20.67528 | |
| NOTTINGHAM | 611 | 20.94599 | |
| Bristol | 528 | 24.23864 | |
| BIRMINGHAM | 515 | 24.85049 | |
| KING | 249 | 51.39759 | |
| sunderland | 460 | 27.82174 | |
| NEWCASTLE UPON TYNE | 457 | 28.00438 | |
| LEEDS | 437 | 29.28604 | |
| WREXHAM | 430 | 29.76279 | |
| SHEFFIELD | 393 | 32.56489 | |
| LIVERPOOL | 390 | 32.81538 | |
| Manchester | 368 | 34.77717 | |
| TotalProducts | 12798 |
@Anonymous
You can try below coding . Thanks
average = DIVIDE(sum(Table1[count]),CALCULATE(SUM(Table1[count]),ALL(Table1)))
Proud to be a Super User!
@Anonymous
Should be the same way. I am not sure if below coding can meet your requirement. You can try this.
average = Divide(calculate(Regioncount,all(table)),Regioncount)
Proud to be a Super User!
Thanks for your reply.
I have now got the calculation done at source level rather than tinkering in Power BI. So working fine now.
@Anonymous
Could you plese try to add a region count measure?
Regioncount= distinctcount ('Product'[Region])
Average= Divide (TotalProducts, Regioncount)
Hope this is helpful for you. Thanks
Proud to be a Super User!
Hi Thanks for your reply. I already tried but didn't get the desired result.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 35 | |
| 31 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 75 | |
| 72 | |
| 38 | |
| 35 | |
| 25 |