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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
wangjuan303
Helper III
Helper III

How to from slicer value find other table related ID value?

I have two tables no relationship,  one table will create slicer for user to pick, another table will create a report to show detailed data,  I need create a measure base on the Slicer value to filter the detail table, I create Measure for sales, I also need create measure filter for ID column, How to create measure for ID column,  Thank you for help.

I know it can filter from flag measure or Sales measure, But in my real report, if I setting filter for ID column, will show over 1000000 row error, because detail table has big volume data, so I need create measure to get ID column 

wangjuan303_0-1647953759517.pngwangjuan303_1-1647953947193.png

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @wangjuan303 ,

 

Please try the following measure:

 

Rank = 
IF (
    [Flag] <> BLANK (),
    RANKX ( ALLSELECTED ( Detail[ID] ), [Sales Measure],, desc )
)

vkkfmsft_0-1648190471161.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-kkf-msft
Community Support
Community Support

Hi @wangjuan303 ,

 

Please try the following measure:

 

Rank = 
IF (
    [Flag] <> BLANK (),
    RANKX ( ALLSELECTED ( Detail[ID] ), [Sales Measure],, desc )
)

vkkfmsft_0-1648190471161.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@wangjuan303 , code seems fine. if this direct query and you are getting error then limit ID column using rank or TOPn (filter level topN)

 

Also refer https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Thank you for your suggestion, yes, my report use direct query,  I try use rankx, it can show, but it run about 3 mins, Can you give me any suggestion? Thank you  

Rank = RANKX(ALL(Detail[ID]),[Sale Measere],,desc)   this run 3 mins
or I need filter Detail[ID] first, then rank it, Can you suggestion some code, Thank you very much

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.