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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Bansi008
Helper III
Helper III

Need help in data transformation.

Hi there,

I have the below sample dataset, which i need to transform in such a way that I can create a few more columns for quarter-to-quarter date comparison.   Can someone please guide how would i do that. 

below my sample dataset :-

NAMEDATERORTVPI
FUND 16/30/202410%1.1x
FUND 13/31/202415%1.3x
FUND 112/31/202417%0.6x
FUND 26/30/202420%1.3x
FUND 23/31/202418%1.8x
FUND 212/31/202425%0.9x
FUND 36/30/20242%1.45x
FUND 33/31/20243%1.2x
FUND 312/31/20244.50%2.3x

 

Expected output table:-

NAMELATEST Q-END DATEPRIOR Q-END DATELATEST Q-END RORPRIOR Q-END RORLATEST Q-END TVPIPRIOR Q-END TVPI
FUND 16/30/20243/31/202410%15%1.1x1.3x
FUND 13/31/202412/31/202415%17%1.3x0.6x
FUND 26/30/20243/31/202420%18%1.3x1.8x
FUND 23/31/202412/31/202418%25%1.8x0.9x
FUND 36/30/20243/31/20242%3%1.45x1.2x
FUND 33/31/202412/31/20243%5%1.2x2.3x
3 ACCEPTED SOLUTIONS
Gabry
Super User
Super User

Hello @Bansi008 

I’m a bit confused about the sample data you provided, and I’m having trouble understanding it fully.

In your transformed table, I noticed that in line 2, the LATEST Q-END ROR is 15%, which corresponds to the ROR for 03/31/2024, and that makes sense. However, I’m puzzled as to why the prior Q-END date is listed as 12/31/2024. Isn't 12/31/2024 after 03/31/2024? Why is it considered "prior"?

If this is just an error in the sample data, I’ve created a sample PBIX file with the calculated columns you need, which is attached. Please have a look and let me know if it works for you.

View solution in original post

Srini_dev
Regular Visitor

I worked out a quick solution for posted issue. I made a small change with the data (change 2024/12/31 to 2023/12/31) which I assumed was supposed to be. I know this isnt the efficient one, but rather a simple solution. Please review the attached .pbi link for more info.

Srini_dev_0-1724677221872.png

 

link to pbi - sample_solution_1.pbix

 

 

View solution in original post

Anonymous
Not applicable

Hi @Bansi008 , hello Srini_dev and Gabry, thank you for your prompt reply!


Based on your requirements, try as follows:

  • Create an index column from 1 in power query as shown below:

vyajiewanmsft_0-1724837221395.png 

 

 

 

 

 

 

 

  • Then create the following measures with the same logic, simply replacing the column names:
PRIOR Q-END DATE = 
VAR CurrentIndex = MAX('Table'[Index])
VAR NextRowValue =
   CALCULATE(
       MAX('Table'[DATE]),
       FILTER(
           ALL('Table'),
           'Table'[Index] = CurrentIndex + 1 &&
           'Table'[Name] = MAX('Table'[Name])
       )
   )
RETURN
   IF(NOT(ISBLANK(NextRowValue)), NextRowValue, BLANK())
PRIOR Q-END ROR = 
VAR CurrentIndex = MAX('Table'[Index])
VAR NextRowValue =
   CALCULATE(
       MAX('Table'[ROR]),
       FILTER(
           ALL('Table'),
           'Table'[Index] = CurrentIndex + 1 &&
           'Table'[Name] = MAX('Table'[Name])
       )
   )
RETURN
   IF(NOT(ISBLANK(NextRowValue)), NextRowValue, BLANK())
PRIOR Q-END TVPI = VAR CurrentIndex = MAX('Table'[Index])
VAR NextRowValue =
   CALCULATE(
       MAX('Table'[TVPI]),
       FILTER(
           ALL('Table'),
           'Table'[Index] = CurrentIndex + 1 &&
           'Table'[Name] = MAX('Table'[Name])
       )
   )
RETURN
   IF(NOT(ISBLANK(NextRowValue)), NextRowValue, BLANK())

Result for your reference:

vyajiewanmsft_3-1724837916269.png

 

Best regards,

Joyce

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Bansi008 , hello Srini_dev and Gabry, thank you for your prompt reply!


Based on your requirements, try as follows:

  • Create an index column from 1 in power query as shown below:

vyajiewanmsft_0-1724837221395.png 

 

 

 

 

 

 

 

  • Then create the following measures with the same logic, simply replacing the column names:
PRIOR Q-END DATE = 
VAR CurrentIndex = MAX('Table'[Index])
VAR NextRowValue =
   CALCULATE(
       MAX('Table'[DATE]),
       FILTER(
           ALL('Table'),
           'Table'[Index] = CurrentIndex + 1 &&
           'Table'[Name] = MAX('Table'[Name])
       )
   )
RETURN
   IF(NOT(ISBLANK(NextRowValue)), NextRowValue, BLANK())
PRIOR Q-END ROR = 
VAR CurrentIndex = MAX('Table'[Index])
VAR NextRowValue =
   CALCULATE(
       MAX('Table'[ROR]),
       FILTER(
           ALL('Table'),
           'Table'[Index] = CurrentIndex + 1 &&
           'Table'[Name] = MAX('Table'[Name])
       )
   )
RETURN
   IF(NOT(ISBLANK(NextRowValue)), NextRowValue, BLANK())
PRIOR Q-END TVPI = VAR CurrentIndex = MAX('Table'[Index])
VAR NextRowValue =
   CALCULATE(
       MAX('Table'[TVPI]),
       FILTER(
           ALL('Table'),
           'Table'[Index] = CurrentIndex + 1 &&
           'Table'[Name] = MAX('Table'[Name])
       )
   )
RETURN
   IF(NOT(ISBLANK(NextRowValue)), NextRowValue, BLANK())

Result for your reference:

vyajiewanmsft_3-1724837916269.png

 

Best regards,

Joyce

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

Srini_dev
Regular Visitor

I worked out a quick solution for posted issue. I made a small change with the data (change 2024/12/31 to 2023/12/31) which I assumed was supposed to be. I know this isnt the efficient one, but rather a simple solution. Please review the attached .pbi link for more info.

Srini_dev_0-1724677221872.png

 

link to pbi - sample_solution_1.pbix

 

 

Gabry
Super User
Super User

Hello @Bansi008 

I’m a bit confused about the sample data you provided, and I’m having trouble understanding it fully.

In your transformed table, I noticed that in line 2, the LATEST Q-END ROR is 15%, which corresponds to the ROR for 03/31/2024, and that makes sense. However, I’m puzzled as to why the prior Q-END date is listed as 12/31/2024. Isn't 12/31/2024 after 03/31/2024? Why is it considered "prior"?

If this is just an error in the sample data, I’ve created a sample PBIX file with the calculated columns you need, which is attached. Please have a look and let me know if it works for you.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors