Forum Discussion

TMorrice's avatar
TMorrice
Regular Visitor
2 years ago

Accrual Report Based on date

Hello, 

We have to report on days worked in current month but not invoiced (Accruals).

Currently we export into excel and do it manually and ive been trying to do it in powerbi with no luck. 

Below is an example of what we are looking for. The system gives us the first 6 columns and id like powerbi to calculate the rest.

I have powerbi giving me a month end/start from a dropdown slicer but the other fields just wont cooperate. 

 

ItemStartEndDays CalcPriceTotalMonth endMonth StartAccrued startAccrued endAccrued Days
Item 19/15/202311/1/202347100470010/31/202310/1/202310/1/202310/31/202330
Item 29/15/202311/1/202347150705010/31/202310/1/202310/1/202310/31/202330
Item 310/15/202310/20/20235105010/31/202310/1/202310/15/202310/20/20235
Item 410/15/202310/20/202353015010/31/202310/1/202310/15/202310/20/20235
Item 510/16/202310/21/202354020010/31/202310/1/202310/16/202310/21/20235
Item 610/17/202310/22/202356030010/31/202310/1/202310/17/202310/22/20235
Item 710/17/202310/22/2023510050010/31/202310/1/202310/17/202310/22/20235
Item 810/17/202311/22/202336200720010/31/202310/1/202310/17/202310/31/202314
Item 910/17/202311/22/2023361036010/31/202310/1/202310/17/202310/31/202314
Item 1010/17/202311/22/20233630108010/31/202310/1/202310/17/202310/31/202314
Item 1110/17/202311/22/20233650180010/31/202310/1/202310/17/202310/31/202314
Item 1210/17/202311/22/20233690324010/31/202310/1/202310/17/202310/31/202314
Item 1311/1/202311/20/202319300570010/31/202310/1/202311/1/202310/31/2023-1
Item 1411/1/202311/20/2023195095010/31/202310/1/202311/1/202310/31/2023-1
Item 1511/1/202311/20/2023191019010/31/202310/1/202311/1/202310/31/2023-1

 

Data is in dataverse, id perfer direct query but can live without. 

2 Replies

  • TMorrice's avatar
    TMorrice
    Regular Visitor

    I appologize for the horrible looking table ive tried everything to style it...the fourm just keeps removeing the style 😞 

  • TMorrice , Try like

     

    month end =maxx(allselected(Date), Date[Date])

    Month Start = Minx(allselected(Date), Date[Date])

    Acrual End =
    var _max = maxx(allselected(Date), Date[Date])
    return
    if(Max(Table[End]) > _max , _max, Max(Table[End]) )


    Acrual Start =
    var _max = Minx(allselected(Date), Date[Date])
    return
    if(Max(Table[Start]) < _min , _min, Max(Table[Start]) )

    Accrued Days = datediff([Acrual Start], [Acrual End] , day)

     

     

    Add +1 to Accrued Days, if needed