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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
thliberato
Helper I
Helper I

TOPN

I have an Incidents table with 3 fields: Incident ID, System Name, Functional Area Name.

Capturar.JPG

 

I need to make a chart that shows the TOPN systems with the highest number of incidents (Counter must be done by the ID field).

 

In addition, I would like to make a Dynamic Filter. I created a TopNOptions table with the values 3,5,10,15 and 20. I would like to insert in canvas a TOPNOptions filter and a TOPN BAR Graph X System (The Graph show the number of Systems selected in TOPNOPTION FILTER). Somebody can help me?

Capturar.3JPG.JPGCapturar2.JPG

 

5 ACCEPTED SOLUTIONS
austinsense
Impactful Individual
Impactful Individual

First, what do we want to rank by ... # of Incidents - let's make a measure for that:

NumIncidents:= COUNTROWS(IncidentsTable)

This assumes of course that the incidents table is one row per incident, if that wasn't the case then you'd want to do a distinctcount on the incidentid

NumIncidents:=DISTINCOUNT( IncidentsTable[IncidentsID] )

Second, we want to rank the systems by the number of incidents - let's make a measure for that

RankSystemsByIncident:=RANKX( ALL( IncidentsTable[System] ), [NumIncidents] )

The piece most people miss here is the ALL() - we don't want to rank the system against itself - we want to rank the system against all the other systems.

 

Third, we want to return a certain number of systems based on a choice - let's pretend for a second that we just want to return all the systems with their rankings - we would put the systems on the rows and drop the ranking in the values. PowerBI has a TOPN function that you could play around with.

 

Shoot, I have to run to a meeting but this should get you started 🙂

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

View solution in original post

Thank you so much. It worked as expected.

View solution in original post

Hi @thliberato,

I am very glad to hear you have resolved your problem. In order to help more people, please mark the corresponding solution as answer. Thanks a lot.

Best Regards,
Angelia

View solution in original post

Hi @v-huizhn-msft, I am new and I didnt find the function (mark as answer).

 

Can you Help me again ?

View solution in original post

Hi @thliberato,

Please review the folloowing screenshot, just click the "Accept as Solution" highlighted in red line.

Capture.PNG

Best Regards,
Angelia

View solution in original post

5 REPLIES 5
austinsense
Impactful Individual
Impactful Individual

First, what do we want to rank by ... # of Incidents - let's make a measure for that:

NumIncidents:= COUNTROWS(IncidentsTable)

This assumes of course that the incidents table is one row per incident, if that wasn't the case then you'd want to do a distinctcount on the incidentid

NumIncidents:=DISTINCOUNT( IncidentsTable[IncidentsID] )

Second, we want to rank the systems by the number of incidents - let's make a measure for that

RankSystemsByIncident:=RANKX( ALL( IncidentsTable[System] ), [NumIncidents] )

The piece most people miss here is the ALL() - we don't want to rank the system against itself - we want to rank the system against all the other systems.

 

Third, we want to return a certain number of systems based on a choice - let's pretend for a second that we just want to return all the systems with their rankings - we would put the systems on the rows and drop the ranking in the values. PowerBI has a TOPN function that you could play around with.

 

Shoot, I have to run to a meeting but this should get you started 🙂

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

Thank you so much. It worked as expected.

Hi @thliberato,

I am very glad to hear you have resolved your problem. In order to help more people, please mark the corresponding solution as answer. Thanks a lot.

Best Regards,
Angelia

Hi @v-huizhn-msft, I am new and I didnt find the function (mark as answer).

 

Can you Help me again ?

Hi @thliberato,

Please review the folloowing screenshot, just click the "Accept as Solution" highlighted in red line.

Capture.PNG

Best Regards,
Angelia

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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