Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
So I have a table with [Tickers] as one column which has about 5 or 6 stock tickers. I also haved a date column which just has weekdays (or when the stock market is open) as this is the data that is pulled in related to the stock tickers. Then I have various columns with calculations based on the data.
So I have some calculations that produce the total value of a stock, but I want to display in my visuals the last value (or last date) for that particular stock instead of the sum of the entire column. I know I can set a relative date filter to go back one day, but this does not really work on the weekend when one day ago was still the weekend so it filters for no data.
My solution was to kind of create an index column based on the [Tickers] column. Then I could create a measure to pull the MAX of the last non-blank value to get what I am looking for. So what I wanted to do was create a running index for each unique ticker in one column. I don't believe I can do this with the standard Index column function in Power BI. I thought a workaround would be to use the Rank function based on the date column for each unique ticker. However, I am stumped on how to rank the date column while filtering for each unique ticker in the [Ticker] column. Would anyone know how to solve this issue?
Solved! Go to Solution.
Hi @Anonymous
Add this calculated column to the Table. It will RANK dates for each ticker separately.
Then you can Filter or Slice by RANK 1 to get the last value
RANK =
RANKX (
FILTER (
ALL ( TableName ),
TableName[Tickers] = EARLIER ( TableName[Tickers] )
),
TableName[Date],
,
DESC,
DENSE
)
Hi @Anonymous
Add this calculated column to the Table. It will RANK dates for each ticker separately.
Then you can Filter or Slice by RANK 1 to get the last value
RANK =
RANKX (
FILTER (
ALL ( TableName ),
TableName[Tickers] = EARLIER ( TableName[Tickers] )
),
TableName[Date],
,
DESC,
DENSE
)
@Anonymous
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.