power bi averages

Public Schedule Face-to-Face & Virtual Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Power BI training and help » Power BI - averages and calculations for forecasting (accounts)

Power BI - averages and calculations for forecasting (accounts)

resolvedResolved · Medium Priority · Version 2016

Power BI - averages and calculations for forecasting (accounts)

Hi,

I'm working on a problem with Accounts Receivable Data. I have created a table in P.BI one showing Client Account No, Client name, Count of paid Invoice number, Average Days to pay, Number of outstanding invoices, Total Outstaning and Average Amount of Days Overdue for payment. The data is coming from 4 data sets with relationships created between them.

i have been asked to work out a way to show if an invoice is likley to be paid in the current month based on historical payments (my average days to pay column)

IM STUCK.

can you calculate on averages? ive tried but all just get ERROR.

Can you use PBI to forecast in this way? (IF days overdue is greater than average days to payment in the next 10 days return a'YES')???

Any help much appreciated.

Thanks

H.

RE: Power BI - averages and calculations for forecasting

Hi Helen,

Thank you for the forum question.

Yes you can calculate average but the DAX measures is all based on your relationships. I need to know more about your data model to be able to help you.

Do you have Due date and Paid date in separate tables? Are the tables related by invoice invoice numbers?

The Average function can only calculate the average of a single column. You may need and AverageX function to do it.


Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Power BI - averages and calculations for forecasting

Hi Jens,

the data is coming from 4 data sets and the are linked by relationships.
1) Credit Control Chased
2) Invoices Outstanding
3) Cash Allocated - Paid invoices data
4) Clients

1 and 2 have a both direction relationship on the invoice number.

2 and 4 have a both direction relationship on the Client Number.

1 and 3 have a both direction relationship on Invoice Number.

Due date in in invoices table and Paid date is in the credit control table.


I have used...
(AVERAGEX('Credit Control',[DAYS_OVERDUE])-AVERAGEX(OA_CASH_ALLOCATED_VW,[Days to Payment]))
to get the difference between the 2 averages. I now need to return a YES if there is 10 days either side of 0 (i.e. -10 through 10)


Any ideas?

thanks

hels

RE: Power BI - averages and calculations for forecasting

sorry, slight change to above

I have used...
(AVERAGEX('Credit Control',[DAYS_OVERDUE])-AVERAGEX(OA_CASH_ALLOCATED_VW,[Days to Payment]))
to get the difference between the 2 averages.

I now need to return a YES if there is a possibility it will be paid in current month i.e. there are more or equal days left in month to average days to payment?


I have a full date file in the model.


Hope that makes some sense?
Thanks

RE: Power BI - averages and calculations for forecasting


Hi Helen,

The If should look like this.



If(AVERAGEX('Credit Control',[DAYS_OVERDUE])-AVERAGEX(OA_CASH_ALLOCATED_VW,[Days to Payment])> DATEDIFF(today(),EOMONTH(today(),0),DAY),"No","Yes")


Let me know if it makes sense. You can get an circular error if the calculation is in the "wrong" table. Please let me know if it is not working.

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Will be marked as resolved in 5 days

Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.

RE: Power BI - averages and calculations for forecasting

Hi Jens,
Happy New Year.

sorry I am just re-visiting this as other item took priority.

I have used
Payment likely =
IF (
AVERAGEX ( 'OA_CREDIT_CONTROL_NOTES_VW', [DAYS_OVERDUE] )
- AVERAGEX ( OA_CASH_ALLOCATED_VW, [Days to Payment] )
> DATEDIFF ( TODAY (), EOMONTH ( TODAY (), 0 ), DAY ),
"No",
"Yes"
)
and I get NO for every line. I cant work out what's gone wrong, any ideas?

Thanks

H

RE: Power BI - averages and calculations for forecasting

Hi Helen,

Happy New Year to you too.


I will need to see your data model. Is it possible for you to send me the file?

The AverageX function probably only filter the number of days for each record in the table you have your If.

If the two tables are related and you have the If in the 'OA_CREDIT_CONTROL_NOTES_VW' table try:

IF (
AVERAGEX ( 'OA_CREDIT_CONTROL_NOTES_VW', [DAYS_OVERDUE] )
- AVERAGEX ( RelatedTable(OA_CASH_ALLOCATED_VW), [Days to Payment] )
> DATEDIFF ( TODAY (), EOMONTH ( TODAY (), 0 ), DAY ),
"No",
"Yes"
)


If you can send me the file please send it to:

info@stl-training.co.uk

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Fri 15 Nov 2019: Automatically marked as resolved.

 

Training courses

 

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Power BI tip:

Master the Power BI Custom Visuals

Power BI offers a variety of custom visuals created by the community and Microsoft. Explore these visuals to enhance your reports and dashboards. Whether it's a custom map, a timeline, or a unique chart type, custom visuals can add significant value to your visualizations.

View all Power BI hints and tips


Server loaded in 0.06 secs.