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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Razorbx13
Post Patron
Post Patron

Checkbook Type of Report

I am trying to take the list of transactions on the left and create a "daily" report similar to what is in the right.  The user could select a day of transactions they wish to see (normally it is the previous day) and then see the transactions for that day with the Beginning Balance being the Ending Balance from the previous day and the ending balance being the ending balance for that day.  Help?

 

Thanks in advance.

 

 

Razorbx13_0-1635960618966.png

 

1 ACCEPTED SOLUTION

See if this works. First the model:
Model.PNG

And to return the maximum description per day, I've added  the number reference in the Dim table as follows:

Dim Table.PNG

And with these measures:

 

Sum Amount = SUM('Table'[ Amount ])
Sum Ending Balance = SUM('Table'[Ending Balance])
Description Number =
CALCULATE (
    MAX ( 'Dim Description'[Transaction Number] ),
    RELATEDTABLE ( 'Table' )
)
Previous Day Balance =
CALCULATE (
    [Sum Ending Balance],
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date]
            = SELECTEDVALUE ( 'Date Table'[Date] ) - 1
            && [Description Number]
                = CALCULATE ( [Description Number], ALLEXCEPT ( 'Table', 'Date Table'[Date] ) )
    )
)
Current Day Ending Balance =
CALCULATE (
    [Sum Ending Balance],
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date] = SELECTEDVALUE ( 'Date Table'[Date] )
            && [Description Number]
                = CALCULATE ( [Description Number], ALLEXCEPT ( 'Table', 'Date Table'[Date] ) )
    )
)

 

you get

result.PNG

 

I've attached the sample PBIX file

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

It would be helpful if you could share sample data to work on!





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Here you go!

 

Operating Account     
      
TransactionDescriptionDate Amount  Ending Balance
Beginning BalanceBeginning Balance11/01/2021             70,302.11     70,302.11
DepositTransaction 111/01/2021              5,865.88     76,167.99
DepositTransaction 211/01/2021              3,647.03     79,815.02
DepositTransaction 311/01/2021                   64.09     79,879.11
DepositTransaction 411/01/2021                 854.08     80,733.19
DepositTransaction 511/02/2021                 617.35     81,350.54
DepositTransaction 611/02/2021                   22.73     81,373.27
DepositTransaction 711/02/2021                   97.56     81,470.83
DepositTransaction 811/02/2021                 112.85     81,583.68
DepositTransaction 911/02/2021                   77.35     81,661.03
DepositTransaction 1011/02/2021              1,373.82     83,034.85
Misc Transaction 1111/03/2021                 300.00     83,334.85
RevenueTransaction 1211/03/2021                 572.82     83,907.67
RevenueTransaction 1311/03/2021              3,508.76     87,416.43
RevenueTransaction 1411/03/2021                   14.53     87,430.96
RevenueTransaction 1511/03/2021             33,085.89    120,516.85
RevenueTransaction 1611/03/2021                 120.20    120,637.05

See if this works. First the model:
Model.PNG

And to return the maximum description per day, I've added  the number reference in the Dim table as follows:

Dim Table.PNG

And with these measures:

 

Sum Amount = SUM('Table'[ Amount ])
Sum Ending Balance = SUM('Table'[Ending Balance])
Description Number =
CALCULATE (
    MAX ( 'Dim Description'[Transaction Number] ),
    RELATEDTABLE ( 'Table' )
)
Previous Day Balance =
CALCULATE (
    [Sum Ending Balance],
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date]
            = SELECTEDVALUE ( 'Date Table'[Date] ) - 1
            && [Description Number]
                = CALCULATE ( [Description Number], ALLEXCEPT ( 'Table', 'Date Table'[Date] ) )
    )
)
Current Day Ending Balance =
CALCULATE (
    [Sum Ending Balance],
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date] = SELECTEDVALUE ( 'Date Table'[Date] )
            && [Description Number]
                = CALCULATE ( [Description Number], ALLEXCEPT ( 'Table', 'Date Table'[Date] ) )
    )
)

 

you get

result.PNG

 

I've attached the sample PBIX file

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.