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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
imo3220
Frequent Visitor

Help Badly Needed!

Hi,

 

Thank you for coming here.

 

I want to see how each 'Key' progress in the National Percentile Rank over the test dates. I need the progress as percentage and values if possible.

 

My table is below;

 

KeyDate of TestNational Percentile Rank
23407/06/202260
23309/09/202168
23431/05/202384
55507/04/202169
55504/05/202385
78907/04/202160
78909/04/202270
78910/04/202380
1 ACCEPTED SOLUTION
Shravan133
Super User
Super User

Hi,

 

Try using this to calculate the %:

Percentile Change =
VAR CurrentTest = MAX('Table'[Date of Test])
VAR PreviousTest = CALCULATE(MAX('Table'[Date of Test]), FILTER('Table', 'Table'[Date of Test] < CurrentTest && 'Table'[Key] = EARLIER('Table'[Key])))
VAR CurrentPercentile = MAX('Table'[National Percentile Rank])
VAR PreviousPercentile = CALCULATE(MAX('Table'[National Percentile Rank]), FILTER('Table', 'Table'[Date of Test] = PreviousTest && 'Table'[Key] = EARLIER('Table'[Key])))
RETURN
IF(ISBLANK(PreviousPercentile), BLANK(), (CurrentPercentile - PreviousPercentile) / PreviousPercentile * 100)

View solution in original post

4 REPLIES 4
Shravan133
Super User
Super User

Hi,

 

Try using this to calculate the %:

Percentile Change =
VAR CurrentTest = MAX('Table'[Date of Test])
VAR PreviousTest = CALCULATE(MAX('Table'[Date of Test]), FILTER('Table', 'Table'[Date of Test] < CurrentTest && 'Table'[Key] = EARLIER('Table'[Key])))
VAR CurrentPercentile = MAX('Table'[National Percentile Rank])
VAR PreviousPercentile = CALCULATE(MAX('Table'[National Percentile Rank]), FILTER('Table', 'Table'[Date of Test] = PreviousTest && 'Table'[Key] = EARLIER('Table'[Key])))
RETURN
IF(ISBLANK(PreviousPercentile), BLANK(), (CurrentPercentile - PreviousPercentile) / PreviousPercentile * 100)

Thank you for the response! It is much appreciated.

 

I am getting this error message; 

 

This expression refers to a Partition object named 'Table[Table]', which has an error.

 

Any ideas?

replace table with your table name.

PercentileChange =
VAR CurrentTestDate = MAX('YourTableName'[Date of Test])
VAR PreviousTestDate =
CALCULATE(
MAX('YourTableName'[Date of Test]),
FILTER(
'YourTableName',
'YourTableName'[Date of Test] < CurrentTestDate &&
'YourTableName'[Key] = EARLIER('YourTableName'[Key])
)
)
VAR CurrentPercentile = MAX('YourTableName'[National Percentile Rank])
VAR PreviousPercentile =
CALCULATE(
MAX('YourTableName'[National Percentile Rank]),
FILTER(
'YourTableName',
'YourTableName'[Date of Test] = PreviousTestDate &&
'YourTableName'[Key] = EARLIER('YourTableName'[Key])
)
)
RETURN
IF(
ISBLANK(PreviousPercentile),
BLANK(),
(CurrentPercentile - PreviousPercentile) / PreviousPercentile * 100
)

Ahh I done that, one was missing. Thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.