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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Sreerams26
Frequent Visitor

Need help on DAX

I have two tables - Sales Invoice Lines containing sales transaction and Ledger table containing all financial accounting entries.  Both these tables have voucher as common item and hence a relation is created.  i need to populate customer's itemized statement in PBI.  I have all the details required in sales invoice except GST and PST.  In the sales, tax is total whereas tax is split in two lines under GL 271000 and 274000 in the ledger table.  when I create a basic measure and/or column for GST and PST, the visual is bringing the GST for all the transaction.  but I want ot display the GST and PSt only for the tax impacted line item.  my table is as below. 

 

Sreerams26_0-1727997818024.png

in the above, total tax is applicable only on 1 line item.  how do I populate the GST and PST only to those lines.

 

my measures are 

GST = CALCULATE(SUM('TAX Entries'[TRANSACTIONCURRENCYAMOUNT]), FILTER('TAX Entries', 'TAX Entries'[MAINACCOUNTID]="271000")) and 
PST = CALCULATE(SUM('TAX Entries'[TRANSACTIONCURRENCYAMOUNT]), FILTER('TAX Entries', 'TAX Entries'[MAINACCOUNTID]="274000"))
 
I have tried columns as 
GSTAX = IF('TAX Entries'[MAINACCOUNTID]="271000", 'TAX Entries'[TRANSACTIONCURRENCYAMOUNT],0)
PSTAX = IF('TAX Entries'[MAINACCOUNTID]="274000", 'TAX Entries'[TRANSACTIONCURRENCYAMOUNT],0).
 
please advise
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Sreerams26 ,

 

Please try the following measures:

GST_Conditional = 
IF(
    SELECTEDVALUE('Sales Invoice Lines'[TotalTax]) > 0, 
    CALCULATE(SUM('TAX Entries'[TRANSACTIONCURRENCYAMOUNT]), 
        FILTER('TAX Entries', 'TAX Entries'[MAINACCOUNTID] = "271000" && SELECTEDVALUE('Sales Invoice Lines'[Voucher]) = 'TAX Entries'[Voucher])
    ),
    ""
)
PST_Conditional = 
IF(
    SELECTEDVALUE('Sales Invoice Lines'[TotalTax]) > 0, 
    CALCULATE(SUM('TAX Entries'[TRANSACTIONCURRENCYAMOUNT]), 
        FILTER('TAX Entries', 'TAX Entries'[MAINACCOUNTID] = "274000" && SELECTEDVALUE('Sales Invoice Lines'[Voucher])= 'TAX Entries'[Voucher])
    ),
    ""
)

 Result for your reference:

vyajiewanmsft_0-1728019881455.png

If this is not feasible, please feel free to reply!

Best regards,

Joyce

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Sreerams26 ,

 

Please try the following measures:

GST_Conditional = 
IF(
    SELECTEDVALUE('Sales Invoice Lines'[TotalTax]) > 0, 
    CALCULATE(SUM('TAX Entries'[TRANSACTIONCURRENCYAMOUNT]), 
        FILTER('TAX Entries', 'TAX Entries'[MAINACCOUNTID] = "271000" && SELECTEDVALUE('Sales Invoice Lines'[Voucher]) = 'TAX Entries'[Voucher])
    ),
    ""
)
PST_Conditional = 
IF(
    SELECTEDVALUE('Sales Invoice Lines'[TotalTax]) > 0, 
    CALCULATE(SUM('TAX Entries'[TRANSACTIONCURRENCYAMOUNT]), 
        FILTER('TAX Entries', 'TAX Entries'[MAINACCOUNTID] = "274000" && SELECTEDVALUE('Sales Invoice Lines'[Voucher])= 'TAX Entries'[Voucher])
    ),
    ""
)

 Result for your reference:

vyajiewanmsft_0-1728019881455.png

If this is not feasible, please feel free to reply!

Best regards,

Joyce

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.