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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PeRoma
Frequent Visitor

Get a random line from a table that is filtered by a slicer

Hi,

I want to get a random line out a table. The table should be filtered by a slicer before selecting the line.

Example:

the starting table is:

ID-no   name   colour

103      shirts   red

204      shirts   blue

101      socks   red

348      jacket  blue

421      jacket  green

333      jacket  red

There is a slicer filtering the colours. I want to use this slicer (at run time) and generate a random selection of e.g. a "red" article.

 

I have had the idea to create a table with all the filtered entries. But I failed to apply the slicer argument to CALCULTETABLE. And the next step should be to get a random line (or ID-no) out of the created table. 

 

But may be there is a better way the create the (random) line or ID-no in a different way.

 

Thank you for any help!

 

2 REPLIES 2
PeRoma
Frequent Visitor

 Hi Fowmy,

Thank you for your reply but you are right, this is not my intension. I want a DAX command pick a random line and show it in a visual. Sorry for not being correct enough.

Fowmy
Super User
Super User

@PeRoma 

A random line can be picked one you select a colour from the slicer, the issue is the number will be static as long as you refresh your model. I think your expectation is not that.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.