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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
wacook
Frequent Visitor

Dynamic Index with Split Data Set

Hi,

 

I have a dataset that looks like:

IDSalesPeriodIndex% of Total
123$10Current Year150%
223$5Current Year2100%
122$17Prior Year133%
222$12Prior Year266%
322$3Prior Year3100%

 

Which I use to create a scatter plot to show current vs prior year sales. In PowerBi, the issue comes in when I need to filter since the index and the % of index (which is just index / max index per period) are both manually done in Excel. So this issue is two fold as I need to create a dynamic index, but also need an index for each Period.

 

For reference, here is the exhibit I use in Excel:

wacook_0-1676393240419.png

Thanks!!

2 REPLIES 2
mark_endicott
Super User
Super User

@wacook - Did this work? Please could you mark it as the solution if yes, this helps other users find it. 

mark_endicott
Super User
Super User

@wacook - here's the DAX for a dynamic index based on the first 3 columns of your table. If you dont need columns in your visual, you can remove them from the ALLSELECTED(). 

 

It is made dynamic because of the PARTITIONBY, which resets the RANK every change of period. 

 

Index = RANK(DENSE, ALLSELECTED( 'Table (3)'[ID], 'Table (3)'[Period], 'Table (3)'[Sales] ) , ORDERBY( 'Table (3)'[Sales],DESC), LAST, PARTITIONBY( 'Table (3)'[Period] ))

 

mark_endicott_0-1719240259981.png

If this works for you, please mark it as the solution.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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