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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
ola7mat
Frequent Visitor

Selecting a specific number of rows to be shown on a visual

Hello, i am trying to create a one page report that users can print without the need for scrolling.

 

The table i have is too long to show all the values and so i want to create a number of tables spread out across the report page.

 

I have a dataset that has scores per individual per day. I am looking to summarising them into a weekly score and then rank them top to bottom and show them in the tables spread left to right?

 

I have worked all day trying to figure this out, any suggestions what can be done?

Capture.PNG

1 ACCEPTED SOLUTION

Hi @ola7mat,

 

I think in your second table, that is a measure in the visual. So we can use RANKX function to work around. Here I made one sample for your reference.

 

Firstly, create a calculated table based on the fact table. And create relationship between the two ones.

 

 

Table = DISTINCT(Table1[ID])

 

Create the measures as below.

 

 

sum = CALCULATE(SUM(Table1[sale]))
ranks = RANKX(ALL('Table'),[sum],,DESC,Dense)

 

Then we can filter the table by the measure ranks.

 

rankx.PNG

 

For more details, please check the pbix as attached. If it doesn't meet your requirement, kindly share your sample data or pbix to me.

 

https://www.dropbox.com/s/kaolwdxeyz4tcgp/Selecting%20a%20specific%20number%20of%20rows%20to%20be%20...

 

Regards,

Frank

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

5 REPLIES 5
v-frfei-msft
Community Support
Community Support

Hi @ola7mat,

 

You can use the Top N function to filter the visual to meet your requirement.

 

top.PNG

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

thanks, this works for the first table where i can select the fixed number of rows to be shown, but with this approach the second table wouldn't allow me to say for example show me the top 20 but not the top 10 or show me the range of rows 10 -20?

Hi @ola7mat,

 

I think in your second table, that is a measure in the visual. So we can use RANKX function to work around. Here I made one sample for your reference.

 

Firstly, create a calculated table based on the fact table. And create relationship between the two ones.

 

 

Table = DISTINCT(Table1[ID])

 

Create the measures as below.

 

 

sum = CALCULATE(SUM(Table1[sale]))
ranks = RANKX(ALL('Table'),[sum],,DESC,Dense)

 

Then we can filter the table by the measure ranks.

 

rankx.PNG

 

For more details, please check the pbix as attached. If it doesn't meet your requirement, kindly share your sample data or pbix to me.

 

https://www.dropbox.com/s/kaolwdxeyz4tcgp/Selecting%20a%20specific%20number%20of%20rows%20to%20be%20...

 

Regards,

Frank

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @ola7mat,

 

Does that make sense? If so, kindly mark my answer as a solution to close the case.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

thanks for this as this is a realy simple explanation that helps me immensily, and sorry for the slow reply as i missed your earlier response.

 

I have a question though based on your suggestion, and i think i know the answer, but do you know what the benefit to having these three steps

Table = DISTINCT(Table1[ID])

 

sum = CALCULATE(SUM(Table1[sale]))
ranks = RANKX(ALL('Table'),[sum],,DESC,Dense)

vs one with all of the steps, if that would even work at all?

ranks = RANKX(ALL(DISTINCT(Table1[ID])),CALCULATE(SUM(Table1[sale])),,DESC,Dense)

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.