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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
arnomics
Helper I
Helper I

Use previous Row Date & Current Row Date to create range for calculation

Hi all,

 

I've been trying to crack this specific requirement.

 

I currently have a Table Visual with Date from Date Column. I've got the below Measure which concatenates Payment info from Payment Table.

 

The result returned with the existing Measure are good. It returns Concatenated values based on the Month Name.

However, I'm now trying to create/use a Range that will help me create a Date Range based on Dates displayed on the visual.

 

i.e instead of using Month Name, I want to use the Date in Current Row & Date in Previous/Earlier row to create a Date Range to concatenate values that fall within the Date Range.

 

Is this something that can be achieved? Or am I trying something that is not possible. Thanks.

VAR SelectedMonths = VALUES('Date'[Month Name])
RETURN
    CALCULATE (
        CONCATENATEX (
            '06 Payment', 
            '06 Payment'[PayDATE] & " $" & '06 Payment'[PaymentAmt],
            ",|  "
        ),
        'Date'[Month Name] IN SelectedMonths, 
        ALLEXCEPT('Date', 'Date'[Month End Date])
    )

 

1 ACCEPTED SOLUTION
miTutorials
Super User
Super User

Please try the offset function. It is explained in the below tutorial. watch from 2:18

 

New Dax Functions in PowerBI | Index, Offset & Window | MiTutorials - YouTube

View solution in original post

2 REPLIES 2
miTutorials
Super User
Super User

Please try the offset function. It is explained in the below tutorial. watch from 2:18

 

New Dax Functions in PowerBI | Index, Offset & Window | MiTutorials - YouTube

Thanks heaps . That worked like a charm.This was my Measure Offset Measure = CALCULATE([TSET], OFFSET(-1,ALLSELECTED(Date'[Date])))However, I have a question. Below is the Offset Measure on a Visual.  Why is the first row for 2023 blank? Ideally, we would expect to see 5/12/2022 12:00:00 AM. Any ideas? Thanks again!

2023-11-07 21_21_08.png

@miTutorials

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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