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
upiotrowska
Regular Visitor

Add column with a dynamic values

Hello, 

I have two tabled dim_company with company_id, company_name....

and fact_company with company_id, date and metrics like eg visits.

 

I need to add a column in the dim table with a ranking by number of visits. So company with the highest number of visits should be 1, ect. When I change values in a date slicer on a dashboard I want the values in Rank column to change accordingly and take into account only sum of visits within a given time rane.

 

How can I create this column?

 

Best

1 REPLY 1
vicky_
Super User
Super User

You cannot do this with a calculated column, as those are not affected by the slicers on your dashboard, and will only be updated at refresh time. Instead, consider using a measure - SQLBI has an article on how to achieve that here: https://www.sqlbi.com/articles/use-of-rankx-in-power-bi-measures/

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.