Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Need help to get output as shown in the below table where ratio is measure i need help to create ratio_1
| Date | Investment Company Name | Transaction Type | Ratio | Ratio_1 |
| 31-12-2022 00:00 | test | Purchase | 1 | |
| 31-01-2023 00:00 | test | FV adjustment | 1 | |
| 28-02-2023 00:00 | test | FV adjustment | 1 | |
| 31-03-2023 00:00 | test | FV adjustment | 1 | |
| 30-04-2023 00:00 | test | FV adjustment | 1 | |
| 30-04-2023 00:00 | test | Sales | 1 | |
| 31-05-2023 00:00 | test | FV adjustment | 1 | |
| 15-06-2023 00:00 | test | Shares Adjustment | 10 | 10 |
| 30-06-2023 00:00 | test | FV adjustment | 10 | |
| 18-07-2023 00:00 | test | Sales | 10 | |
| 19-07-2023 00:00 | test | Sales | 10 | |
| 20-07-2023 00:00 | test | Sales | 10 | |
| 23-07-2023 00:00 | test | Sales | 10 | |
| 24-07-2023 00:00 | test | Sales | 10 | |
| 25-07-2023 00:00 | test | Sales | 10 | |
| 27-07-2023 00:00 | test | Sales | 10 | |
| 04-09-2023 00:00 | test | Sales | 10 | |
| 05-09-2023 00:00 | test | Sales | 10 | |
| 28-09-2023 00:00 | test | Sales | 10 | |
| 30-09-2023 00:00 | test | Shares Adjustment | 5 | 5 |
| 31-10-2023 00:00 | test | FV adjustment | 5 | |
| 02-11-2023 00:00 | test | Sales | 5 | |
| 06-11-2023 00:00 | test | Sales | 5 | |
| 30-11-2023 00:00 | test | FV adjustment | 5 | |
| 14-12-2023 00:00 | test | Sales | 5 | |
| 18-12-2023 00:00 | test | Sales | 5 | |
| 20-12-2023 00:00 | test | Sales | 5 | |
| 24-12-2023 00:00 | test | Sales | 5 | |
| 25-12-2023 00:00 | test | Sales | 5 |
Solved! Go to Solution.
Could you please elaborate the requirement along with the calculation?
Try the below dax for Ratio_1
Ratio_1 =
VAR CurrentDate = TableName[Date]
VAR LastAdjustmentDate =
CALCULATE(
MAX(TableName[Date]),
FILTER(
TableName,
TableName[Transaction Type] = "Shares Adjustment" &&
TableName[Date] <= CurrentDate
)
)
VAR LastRatio =
CALCULATE(
MAX(TableName[Ratio]),
FILTER(
TableName,
TableName[Transaction Type] = "Shares Adjustment" &&
TableName[Date] = LastAdjustmentDate
)
)
RETURN
IF(
NOT ISBLANK(LastAdjustmentDate),
LastRatio,
BLANK()
)
Create a calculated column in Power BI:
Ratio_1 =
VAR CurrentDate = 'Table'[Date]
VAR LastSharesAdjustmentDate =
CALCULATE(
MAX('Table'[Date]),
FILTER(
'Table',
'Table'[Date] <= CurrentDate &&
'Table'[Transaction Type] = "Shares Adjustment"
)
)
VAR LastRatio =
CALCULATE(
MAX('Table'[Ratio]),
FILTER(
'Table',
'Table'[Date] = LastSharesAdjustmentDate
)
)
RETURN
IF(
ISBLANK('Table'[Ratio]),
LastRatio,
'Table'[Ratio]
)
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
Create a calculated column in Power BI:
Ratio_1 =
VAR CurrentDate = 'Table'[Date]
VAR LastSharesAdjustmentDate =
CALCULATE(
MAX('Table'[Date]),
FILTER(
'Table',
'Table'[Date] <= CurrentDate &&
'Table'[Transaction Type] = "Shares Adjustment"
)
)
VAR LastRatio =
CALCULATE(
MAX('Table'[Ratio]),
FILTER(
'Table',
'Table'[Date] = LastSharesAdjustmentDate
)
)
RETURN
IF(
ISBLANK('Table'[Ratio]),
LastRatio,
'Table'[Ratio]
)
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
thanks for help
Could you please elaborate the requirement along with the calculation?
For every row after a "Shares Adjustment", ratio_1 will keep the last ratio until the next "Shares Adjustment" occurs, at which point it updates the value of ratio_1.
Try the below dax for Ratio_1
Ratio_1 =
VAR CurrentDate = TableName[Date]
VAR LastAdjustmentDate =
CALCULATE(
MAX(TableName[Date]),
FILTER(
TableName,
TableName[Transaction Type] = "Shares Adjustment" &&
TableName[Date] <= CurrentDate
)
)
VAR LastRatio =
CALCULATE(
MAX(TableName[Ratio]),
FILTER(
TableName,
TableName[Transaction Type] = "Shares Adjustment" &&
TableName[Date] = LastAdjustmentDate
)
)
RETURN
IF(
NOT ISBLANK(LastAdjustmentDate),
LastRatio,
BLANK()
)
thanks for help
Hi @praveenjujare , can you be more clear? What ratio_1 calculate? what are conditions?
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!