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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Data table to display preceding data based on date slicer

Hi Community,

 

I have a data set that contains transaction records based on a certain transaction dates. These transactions are reported as of a quarter end date. 

 

Visualization: Data table

 

Based on my filter date selection, I would like my table to show all past transactions, up to my quarter end date.

 

For ex, I have 5 transaction as of date 2020 Q1 and 2 transactions as of date 2020 Q2.

When I filter on date 2020 Q1, table shows 5 transactions

When I filter on date 2020 Q2, the table should display 7 transactions (5 of prior quarter and 2 current)

 

Attaching a copy of the Sample PBIX 

 

Thanks,

Brian

 

@AlexisOlson, Does this fall in your forte? Thanks 🙂

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

1.  it's great that you have the same column in two tables,  

v-xiaotang_6-1623293479847.png

2. then keep the 2 tables disconnected, and drag the column Quarter in Date table into slicer

v-xiaotang_1-1623290298344.png

3. create the filter measure by using Date column(type:date) and Quarter column(type:text) in your table Data, and drag it into the filter on this visual 

 

filterMeasure =
VAR _selQ =
    SELECTEDVALUE ( 'Date'[Quarter] )
VAR _selDate =
    CALCULATE (
        MAX ( Data[As Of Date] ),
        FILTER ( ALL ( Data ), Data[As of Date - Year Quarter] = _selQ )
    )
VAR _startDate =
    DATE ( YEAR ( _selDate ), 1, 1 )
RETURN
    IF (
        ISBLANK ( _selQ ),
        1,
        IF (
            MIN ( Data[As Of Date] ) >= _startDate
                && MIN ( Data[As Of Date] ) <= _selDate,
            1,
            0
        )
    )

 

 

v-xiaotang_8-1623293686883.png

 

result:

v-xiaotang_4-1623293314858.png

v-xiaotang_5-1623293329154.png

See sample file attached bellow.

 

Best Regards,

Community Support Team _ Tang

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

 

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

1.  it's great that you have the same column in two tables,  

v-xiaotang_6-1623293479847.png

2. then keep the 2 tables disconnected, and drag the column Quarter in Date table into slicer

v-xiaotang_1-1623290298344.png

3. create the filter measure by using Date column(type:date) and Quarter column(type:text) in your table Data, and drag it into the filter on this visual 

 

filterMeasure =
VAR _selQ =
    SELECTEDVALUE ( 'Date'[Quarter] )
VAR _selDate =
    CALCULATE (
        MAX ( Data[As Of Date] ),
        FILTER ( ALL ( Data ), Data[As of Date - Year Quarter] = _selQ )
    )
VAR _startDate =
    DATE ( YEAR ( _selDate ), 1, 1 )
RETURN
    IF (
        ISBLANK ( _selQ ),
        1,
        IF (
            MIN ( Data[As Of Date] ) >= _startDate
                && MIN ( Data[As Of Date] ) <= _selDate,
            1,
            0
        )
    )

 

 

v-xiaotang_8-1623293686883.png

 

result:

v-xiaotang_4-1623293314858.png

v-xiaotang_5-1623293329154.png

See sample file attached bellow.

 

Best Regards,

Community Support Team _ Tang

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

 

Anonymous
Not applicable

Thanks so much,

 

I incorporated the disconnected table and a simpler solution which is just check if date values are less than or equal to selected date then 1, else 0. Pulled this measure as a filter in the table and filtered to only 1's.

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.