cancel
Showing results for 
Search instead for 
Did you mean: 
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 Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!