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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
BalajiBuddha
Frequent Visitor

Average Overdue days showing wrong values (Power BI)

HI Everyone,

Can anyone help me why it is showing worng average total when i compare to excell with power bi, if calculation is wrong please correct me.

Average Overdue Days_Column =

    VAR A =

        IF(

            SALES_LEDGER_PAYMENTS_M3[Invoice Paid] IN {"No", "Partial"},

            SALES_LEDGER_PAYMENTS_M3[Overdue Days],

            IF(

                SALES_LEDGER_PAYMENTS_M3[Invoice Paid] = "Yes but Overdue",

                SALES_LEDGER_PAYMENTS_M3[Days between Due Date and Payment Date],

                BLANK()

            )

        )

    RETURN IF(ISBLANK(A), 0, A)

Based on above measure i am calculation Average like below

New Average OverdueDays =

CALCULATE(AVERAGEX(SALES_LEDGER_PAYMENTS_M3,SALES_LEDGER_PAYMENTS_M3[Average Overdue Days_Column]))



BalajiBuddha_0-1769593751365.png

 

BalajiBuddha_1-1769593764284.png

 

1 ACCEPTED SOLUTION
v-prasare
Community Support
Community Support

Hi @BalajiBuddha,

We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.

 

 

Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support

View solution in original post

4 REPLIES 4
v-prasare
Community Support
Community Support

Hi @BalajiBuddha,

We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.

 

 

Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support

v-prasare
Community Support
Community Support

Hi @BalajiBuddha,

We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.

 

 

Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support

cengizhanarslan
Super User
Super User

Your Power BI “average total” is wrong because your logic is forcing blanks to 0, and AVERAGEX includes those zeros in the denominator. Use the below calculated column instead:

 

Average Overdue Days (Column) =
IF (
SALES_LEDGER_PAYMENTS_M3[Invoice Paid] IN { "No", "Partial" },
SALES_LEDGER_PAYMENTS_M3[Overdue Days],
IF (
SALES_LEDGER_PAYMENTS_M3[Invoice Paid] = "Yes but Overdue",
SALES_LEDGER_PAYMENTS_M3[Days between Due Date and Payment Date],
BLANK()
)
)

 

Then your average measure can simply be:

New Average OverdueDays =
AVERAGE ( SALES_LEDGER_PAYMENTS_M3[Average Overdue Days (Column)] )
_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
pankajnamekar25
Super User
Super User

Hello @BalajiBuddha 

Try with measure approach

Average Overdue Days =
AVERAGEX (
SALES_LEDGER_PAYMENTS_M3,
SWITCH (
TRUE (),
SALES_LEDGER_PAYMENTS_M3[Invoice Paid] IN { "No", "Partial" },
SALES_LEDGER_PAYMENTS_M3[Overdue Days],
SALES_LEDGER_PAYMENTS_M3[Invoice Paid] = "Yes but Overdue",
SALES_LEDGER_PAYMENTS_M3[Days between Due Date and Payment Date],
BLANK ()
)
)


If my response helped you, please consider clicking
Accept as Solution and giving it a Like 👍 – it helps others in the community too.


Thanks,


Connect with me on:

LinkedIn

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.