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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Issue with refund calculation per month

Hi all,

I'm pretty new to power bi. I need to calculate some refunds for my boss, but can't get the right calculation.

I have a table (Sheet1) with billing type (credit(refund) and invoice(turnover). This is the current formula, but this one calculates it wrong, because now all payed refunds will be divived by turnover that month. But the refunds can be from an order before.

So when July has a turnover of 1000 and August of 500 and the credits are 200, then it will say 200/500 = 40% refund. For example 150 is from July and 50 from August. This will mean 150/1000 = 15% from July in August and 50/500 = 10% in August from August = 25% refund August. This can apply for up to 12 months backwards. The fields of the occurring month is "Billing year" and "Billing month". The field of which month the order is, is called "Hulp". Please share your insights with me 

Fidelis1990_0-1633350937055.png

 

 

Refund% = (CALCULATE(sum(Sheet1[EUR sales]),FILTER(Sheet1, Sheet1[Billing type]="Credit Memo")))/CALCULATE(sum(Sheet1[EUR sales]),FILTER(Sheet1, Sheet1[Billing type]="Invoice"))*-1
 
Company codeContinentSales accountBilling typeHulpveld billing dateBilling yearBilling monthEUR sales
2000EuropeB2BInvoice202109202193000
2000EuropeB2BInvoice202108202184000
2000EuropeB2BInvoice202107202175000
2000EuropeB2BInvoice202106202167500
2000EuropeB2BCredit memo20210920219150
2000EuropeB2BCredit memo20210820219100
2000EuropeB2BCredit memo20210720219250
2000EuropeB2BCredit memo20210620219250
2000EuropeB2BCredit memo20210820218200
2000EuropeB2BCredit memo20210720218100
2000EuropeB2BCredit memo20210620218300
2000EuropeB2BCredit memo20210720217100
2000EuropeB2BCredit memo20210620217500

 

Expected outcomejulyaugustseptember
202109  5,00%
202108 5,00%2,50%
2021072,00%2,00%5,00%
2021066,67%4,00%3,33%
Refund%8,67%11,00%15,83%
4 REPLIES 4
Anonymous
Not applicable

Bump

smpa01
Super User
Super User

@Anonymous  please try

 

Refund% =
VAR _credit =
    CALCULATE (
        SUM ( Sheet1[EUR sales] ),
        FILTER ( VALUES ( Sheet1[Billing type] ), Sheet1[Billing type] = "Credit Memo" )
    )
VAR _invoice =
    CALCULATE (
        SUM ( Sheet1[EUR sales] ),
        ALL ( Sheet1[Billing month] ),
        Sheet1[Billing type] IN { "Invoice" }
    )
RETURN
    DIVIDE ( _credit, _invoice )

 

smpa01_0-1633623144947.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Anonymous
Not applicable

Unfortunatly I didn't receive a different result (Refund %2 = your formula)

Fidelis1990_1-1634021833608.png

 

Anonymous
Not applicable

 Am I allowed to bump this, because first it was unjustly marked as spam.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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