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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sdiniz73
Regular Visitor

Previous Row Date

Hello, I would like to bring in a report the records containing the start date and the previous start date in the same line.
I've already done some calculations using "index", however, when applying a filter, the calculation does not bring the information of the previous date that is being displayed on the screen.

1 ACCEPTED SOLUTION
sdiniz73
Regular Visitor

Hello, sorry for the delay, but I ended up solving it by creating separate measures (not columns), it wasn't very nice but it was the only solution I got. I will soon put a template here. Thanks.

View solution in original post

9 REPLIES 9
sdiniz73
Regular Visitor

Hello, sorry for the delay, but I ended up solving it by creating separate measures (not columns), it wasn't very nice but it was the only solution I got. I will soon put a template here. Thanks.

Hi  @sdiniz73 ,

 

Thanks  in advance for sharing.🙂

 

 

 

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

sdiniz73
Regular Visitor

The ultimate goal is this:

Screenshot_5.png

Display current and previous start date on the same line.

In sql found the function "lag" returns the information correctly.

To try to work around the problem, I changed the table data source to sql and in SQL I inserted the Lag.

It even works a little, but when selecting some filters, the information doesn't match.

 

/

In the example below, we have the desired information in Power BI using LAG (SQL) in the data source.

Screenshot_4.png

In the example below with the filters selected, the information is wrongScreenshot_6.png

Using the Index, it works only on the table, when creating the report, the data is also lost.

Hi  @sdiniz73 ,

 

Is your issue solved now?Have you checked my last reply?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Hi  @sdiniz73 ,

 

Could you pls share some dummy data with expected output for test?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Hi,

It is easier to do this in a calculated column formula.  Would you be interested in that?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

Yes, but when I run the filters, the calculated column does not display the values ​​correctly. Would you have an example calculated column?

Hi,

I can try to solve this with a measure.  Can you share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Share some data, describe the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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