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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
nadir
Frequent Visitor

Vendor Statement of Account

Hi
I am trying to create a Vendor Statement of Accout based on Slicer date selection  from a data that has Debit,Credit , Date among other fields and a Calendar table , the required output is
Opening Balance = Sum of Net Change amounts before minimum date selected as measure below

               Total Opening Balance = CALCULATE([Total Debit Minus Credit],
                filter(ALL('Calendar'),
                'Calendar'[Date] < MIN('Calendar'[Date])
                  )
                 )


Debit = Sum of Debit Amounts
Credit = Sum of Credit Amounts
Net Change = Debit - Credit
Ending Balance = Opening Balance + Net Change
Issue:
Summary report for a date range 01/01/2019 till 31/12/2019is working fine as below

Vendor IDName Opening BalanceDebitCreditnet chamgeEnding balance
20177Name 10480594805900

but detasiled report is showing all transactions before minimum  selected date for the Opening Balance , in other words the data before minimum selected date should be summed up in one total amount and show as opening balance as one record in the report

Vendor IDNameDoc NumberDateDescription Opening BalanceDebitCreditnet chamgeEnding balance
20177Name 1INV00000004095319/06/2014Description 1              (53,000.00)             (53,000.00)
20177Name 1203719/06/2014Description 1                17,000.00               17,000.00
20177Name 1212728/09/2014Description 1                12,000.00               12,000.00
20177Name 1222015/12/2014Description 1                12,000.00               12,000.00
20177Name 1235526/04/2015Description 1                12,000.00               12,000.00
20177Name 112-12923/12/2015Description 1              (12,000.00)             (12,000.00)
20177Name 1236823/12/2015Description 1                12,000.00               12,000.00
20177Name 1274422/03/2016Description 1    12,000.00   12,000.00                    -                             -  
20177Name 1248415/06/2016Description 1    12,000.00                  -       12,000.00            12,000.00
20177Name 1Jun-1615/06/2016Description 1                   -     12,000.00  (12,000.00)          (12,000.00)
20177Name 109-Oct19/09/2016Description 1                   -     12,000.00  (12,000.00)          (12,000.00)
20177Name 1293628/09/2016Description 1    12,000.00                  -       12,000.00            12,000.00
20177Name 1Dec-7931/12/2016Description 1                   -     12,059.00  (12,059.00)          (12,059.00)
20177Name 1301231/12/2016Description 1    12,059.00                  -       12,059.00            12,059.00

 

Any help will be appreciated
Nadir

 

5 REPLIES 5
v-yingjl
Community Support
Community Support

Hi, @nadir  ,

According to your description, if you want to create a dynamic calculated table based on the slicer, I am afraid that it is not supported in power bi  becasue not like measures, the calculated column/table is calculated during database processing (such as data refresh) and then stored in the model , They will not respond to user choices on the report.

One way to create a new table that meets your requirements is that you can create a calculated table like this and need to manually change the date in the filter formula as needed.

 

 

Table =
VAR tab1 =
    FILTER (
        ALL ( 'Vendor Statement' ),
        'Vendor Statement'[Date] >= DATE ( 2016, 1, 1 )
            && 'Vendor Statement'[Date] <= DATE ( 2016, 12, 31 )
    )
VAR tab2 =
    FILTER (
        ALL ( 'Vendor Statement' ),
        NOT (
            'Vendor Statement'[Date] >= DATE ( 2016, 1, 1 )
                && 'Vendor Statement'[Date] <= DATE ( 2016, 12, 31 )
        )
    )
VAR _row =
    ROW (
        "Vendor ID", MAXX ( tab2, [Vendor ID] ),
        "Name", MAXX ( tab2, [Name] ),
        "Doc Number", "Summarize doc",
        "Date", MAXX ( tab2, [Date] ),
        "Description", MAXX ( tab2, [Description] ),
        "Opening Balance", SUMX ( tab2, [ Opening Balance] ),
        "Debit", SUMX ( tab2, [Debit] ),
        "Credit", SUMX ( tab2, [Credit] ),
        "net change", SUMX ( tab2, [net chamge] ),
        "Ending balance", SUMX ( tab2, [Ending balance] )
    )
RETURN
    UNION ( tab1, _row )

 

 

tbb.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thanks 

 

v-yingjl
Community Support
Community Support

Hi @nadir ,

As I previous posted, power bi could not support create dynamic calculated table based on selected slicer.

Please refer:

  1. Dynamic Table based on Slicers 
  2. Based-on-slicer-selection-create-dynamic-calculated-table-in-power-bi 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AlB
Community Champion
Community Champion

Hi @nadir 

Can you share the pbix?

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

nadir
Frequent Visitor

Hi AIB,

 

Sorry for larte reply.

 

I am sending the link for an excel file that has all the transactions which will be used along with a normal date table , I can not shatre the PBIX file since it has company data.

Another point the report date is 01/01/2016 till 31/12/2016

https://www.dropbox.com/scl/fi/s1xnho0vxawrybyebpdwp/Vendor-Statement.xlsx?dl=0&rlkey=aj6gcjeiv35q5q...

 

Rgeards

Nadir

 

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.

Top Solution Authors