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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
austin316
Regular Visitor

Creating two columns cash book

Hello Experts.

Am having a bit of some challenge, trying to implement a two-column cash book logic as an expression

on sql server report builder

 

The idea is to subtract [Debit amount] – [Credit Amount] = [Balance]

However, am unable to write an expression that subtracts OR add automatically to the [balance] as a result of input on the [Debit amount] OR [Credit Amount] columns  .

 

austin316_0-1668926335147.png

 

1 ACCEPTED SOLUTION

Hi  @austin316 ,

In my opinion ,it is earsier to get this in Power BI Desktop , you could add column in Power BI Desktop ,then publish to service ,and use Power BI Report Builder to get data from Power BI Service.See below for a quicker way to get the results you want, and don't bother with the complex statements in the Power BI Paginated Report Builder.

fact = CALCULATE(SUM('Table'[Debt]),FILTER('Table','Table'[Date]<=EARLIER('Table'[Date])))-CALCULATE(SUM('Table'[credit]),FILTER('Table','Table'[Date]<=EARLIER('Table'[Date])))

vluwangmsft_0-1669624398302.png

 

vluwangmsft_1-1669624424334.png

vluwangmsft_2-1669624436526.png

vluwangmsft_3-1669624558235.png

 

 

Best Regards

Lucien

 

View solution in original post

4 REPLIES 4
dominek
New Member

It may be easier to solve this problem through Excel. Enter the formula in the line and get the report. I learned this in computer science college when we were taught these tables. Sometimes I missed school, but I still managed to study because of some services https://gradesfixer.com/free-essay-examples/freedom/ Then I worked at the cash register and dealt with similar tables

austin316
Regular Visitor

thanks for the above.

However what I desire is like below. 

 

DateDebtcreditBalance
8/8/2022404
8/9/2022040
8/10/202210010
8/11/202210020
8/12/20220515

 

 1. [ 8/8/2022]  Debt - Credit = [Balance]

2. [8/9/2022] what ever comes on either the [Debt or Credit] affect [add or substract ] the [balance]

 

Note: Not calcualting individual lines seperatly.

Hi  @austin316 ,

In my opinion ,it is earsier to get this in Power BI Desktop , you could add column in Power BI Desktop ,then publish to service ,and use Power BI Report Builder to get data from Power BI Service.See below for a quicker way to get the results you want, and don't bother with the complex statements in the Power BI Paginated Report Builder.

fact = CALCULATE(SUM('Table'[Debt]),FILTER('Table','Table'[Date]<=EARLIER('Table'[Date])))-CALCULATE(SUM('Table'[credit]),FILTER('Table','Table'[Date]<=EARLIER('Table'[Date])))

vluwangmsft_0-1669624398302.png

 

vluwangmsft_1-1669624424334.png

vluwangmsft_2-1669624436526.png

vluwangmsft_3-1669624558235.png

 

 

Best Regards

Lucien

 

v-luwang-msft
Community Support
Community Support

Hi @austin316 ,

What I uesd is  Power BI Report Builder,you could test it to create new column:

.Difference between Power BI Report Builder and Microsoft Report Builder

 

Power BI Report Builder is optimized for RDL reports in the Power BI service, which can log into Power BI, allow you to open and save reports from the workspace, and support querying Power BI advanced datasets and datasets of non-advanced users that have been published to the service.

 

base data:

vluwangmsft_0-1668999680125.png

 

 

new field:

vluwangmsft_1-1668999710476.png

 

Output result:

vluwangmsft_2-1668999732714.pngvluwangmsft_3-1668999755145.png

 

Best Regards

Lucien

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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