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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
ronaldbalza2023
Continued Contributor
Continued Contributor

Repeating Amount - DAX Measure

I have 5 tables (Invoices,Credit Notes,Journals,Accounts & Tracking Categories) that are connected with each other with the following DAX measures below. 

 

Now, when I bring the tracking categories as column, it gives me a weird calculation with most of the columns have zero values on them. 

 

Without Tracking Categories - Works fine

ronaldbalza2023_0-1632577349878.png

ronaldbalza2023_1-1632577375606.png

 

With Tracking Categories - most of columns were zero values.

ronaldbalza2023_3-1632577862341.pngronaldbalza2023_4-1632577878772.png

 

 

Dax Measures

P&L = 
CALCULATE (
    SUM ( 'Invoices'[Line Amount Calculation] ),
    FILTER (
        'Accounts',
        Accounts[Class] = "Revenue"
            || Accounts[Class] = "Expense"
    )
) - [P&L - Credit Notes] + [P&L (Journals)]

 

P&L - Credit Notes = 
CALCULATE (
    SUM ( 'Credit Notes'[Line Amount Credit Note Calculation] ),
    FILTER (
        'Accounts',
        Accounts[Class] = "Revenue"
            || Accounts[Class] = "Expense"
    )
)

 

P&L (Journals) = 
CALCULATE (
    0 - ( SUM ( 'Journals'[Net Amount] ) ),
    FILTER ( 'Journals', 'Journals'[Split] = "JOURNALS" ),
    FILTER (
        'Accounts',
        Accounts[Class] = "Revenue"
            || Accounts[Class] = "Expense"
    )
)

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@ronaldbalza2023 Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,thanks for taking the time on this.  Here you go. 

1. Sample Data

Accounts Table

Account TypeNameAccount_UID
RevenueSales1
RevenueSales2
RevenueInterest Income3
RevenueInterest Income4
Direct CostsClient Gifts5
Direct CostsClient Gifts6
Direct CostsSalary & Wages7
Direct CostsSalary & Wages8
ExpensesBank Fees9
ExpensesBank Fees10
ExpensesMotor Vehicles11
ExpensesMotor Vehicles12
ExpensesOffice Expenses13
ExpensesOffice Expenses14

 

Invoices Table

Line Amount CalculationAccount_UIDTracking Categories_ID
$6,00011
$1,50022
$25031
$10042
$40051
$5062
$1,00071
$20082
$40091
$200102
$500111
$150122
$250131
$0142

 

Journals Table

Net AmountAccount_UIDTracking Categories_ID
$1,50011
$2,00022
$1,50031
$20042
$10051
$5062
$1,50071
$1,50082
$5091
$50102
$500111
$850122
$100131
$250142

 

Credit Notes Table

Line Amount Credit Note CalculationAccount_UIDTracking Categories_ID
$50011
$1,00022
$25031
$20042
$051
$10062
$071
$10082
$5091
$0102
$0111
$0122
$150131
$0142

 

Tracking Categories

Tracking Categories_IDName
11 Marquis
21 Yabtree

 

2. Expected Output

Account Type1 Marquis1 Yabtree
    + Revenue$ 10,000$ 5,000
          Sales$ 8,000$ 4,500
          Interest Income$ 2,000$ 500
    + Direct Costs($ 3,000)($ 2,000)
          Client Gifts($ 500)($ 200)
          Salary & Wages ($ 2,500)($ 1,800)
    + Expenses($ 2,000)($ 1,500)
          Bank Fees($ 500)($ 250)
          Motor Vehicles($ 1,000)($ 1,000)
          Office Expenses($ 500)($ 250)
Total$ 5,000$ 1,500

 

3. Invoices Table, Credit Notes Table, Journals Table are connected with Accounts Table using Account_UID column. (many to one)

Invoices Table, Credit Notes Table, Journals Table are connected with Tracking Categories Table using Tracking Categories_ID column (many to one)

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.