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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ahmedalam
Helper I
Helper I

PBI based Trial Balance with Date Slicer

Hello Experts,

 

I am developing a Trial Balance report with following criteria.

 

- I have created one DateTable and mark as Date Table.

- I have created one DAX based table for the list of transaction

- Created a link in between DateTable and Transaction Table

 

The problem is, when I have created the Slicer from DateTable w.r.t. Date the Transaction Table won't filter according to the slicer date. In slicer I am using Between.

 

Transaction table consist of following fields:

- Account ID & name

- Transaction amount - Dr

- Transaction amount - Cr

- Transaction date

 

For example:

OBCr = CALCULATE(
    SUM(GJEntriesTable[Credit]),
    KEEPFILTERS(DateTable[Date]))
 
OBDr = CALCULATE(
    SUM(GJEntriesTable[Debit]))
 
OB = OBCr + OBDr

 

1 ACCEPTED SOLUTION
ahmedalam
Helper I
Helper I

Hello Expert,

 

Thanks for your valueable time. I have found the solution and it's working perfectly fine.

 

OBDr =
VAR StartDate =
    CALCULATE(
        MIN ( DateTable[Date] ),
        ALLSELECTED ( DateTable )
    )
RETURN
CALCULATE(
    SUM ( GJEntriesTable[Debit] ),
    FILTER(
        ALLEXCEPT( GJEntriesTable, GJEntriesTable[Account Name] ),
        GJEntriesTable[AccountingDate] < StartDate
    )
)

View solution in original post

9 REPLIES 9
ahmedalam
Helper I
Helper I

Hello Expert,

 

Thanks for your valueable time. I have found the solution and it's working perfectly fine.

 

OBDr =
VAR StartDate =
    CALCULATE(
        MIN ( DateTable[Date] ),
        ALLSELECTED ( DateTable )
    )
RETURN
CALCULATE(
    SUM ( GJEntriesTable[Debit] ),
    FILTER(
        ALLEXCEPT( GJEntriesTable, GJEntriesTable[Account Name] ),
        GJEntriesTable[AccountingDate] < StartDate
    )
)
xifeng_L
Super User
Super User

Hi @ahmedalam 

 

From the measure expression, the result should change with the slicer.

 

You can check if the filtering direction on both ends of the relationship is correct, and change it to a display format with time to check if the date fields on both ends match exactly.

 

If not possible, you can further describe the phenomenon, such as whether the result does not change with the slicer, whether it displays null values or total values, or other situations. Additionally, sample data or PBIX files can also be provided.

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

Following are the snapshot related to the questions.

 

OBDr =
VAR StartDate = MIN ( DateTable[Date] )
RETURN
CALCULATE (
    SUM ( GJEntriesTable[Debit] ),
    FILTER (
        ALL ( DateTable ),   // remove filters from transactions
        DateTable[Date] < StartDate
    )
)
 
OBCr =
VAR EndDate = MAX ( DateTable[Date] )
RETURN
CALCULATE (
    SUM ( GJEntriesTable[Credit] ),
    FILTER (
        ALL ( DateTable ),   // remove filters from transactions
        DateTable[Date] < EndDate
    )
)

 

TB_1.jpgTB_2.jpgTB_3.jpgTB_DateTable_Date.jpgTB_DateTable_Mark.jpgTB_GJEntriesTable_AccountingDate.jpgTB_MainScreen.jpg

Your current expression calculates the cumulative value of OBDR and OBCR that is less than the StartDate or EndDate selected by the slicer.

 

If the logic is correct, then the expression is not incorrect. You can change the date range a little wider and see if the values will change.

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

I have increased or decreased the date range but no effect.

maybe is the data issue, can you upload the pbix file? if yes, pls pay attention to desensitization.

Well, it's quite difficult to publish the PBIX you know the data sensitivity. Is there any other way?

ahmedalam
Helper I
Helper I

OBCr = CALCULATE(
    SUM(GJEntriesTable[Credit]),
   
        FILTER (
        ALL ( DateTable ),
        DateTable[Date] <= MIN( DateTable[Date] )
))

OBCr = CALCULATE(
    SUM(GJEntriesTable[Credit]),
   
        FILTER (
        ALL ( DateTable ),
        DateTable[Date] <= MIN( DateTable[Date] )
))
 
OB = [OBCr] + [OBDr]
ahmedalam
Helper I
Helper I

The value of OBDr or OB or OBCr these are all Measures

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.