cancel
Showing results for
Did you mean:
Highlighted
Helper I

Top 10 with filter

Hello all,

I have one table with the Machine name , the number of Alarms and the alarm nature. I want to create a simple graph with the top 10 of the machines with the hightest number of alarms.

But some have in name the word "error" , so i want to filter in order to show only the machines that don't contain this word.
So, i have created the top 10 tab. But isn't filter the name...do you know the reason?

`NewTable = Calculate(TOPN(10,SUMMARIZE(SampleTable,SampleTable[Machine],"TotalAlarms",SUM(SampleTable[Alarms]) )); SampleTable[Machine] <> "% error % ")`

 Machine Alarms Nature A 14 a A 14 s A 14 f A 14 g B 13 a B error 13 g D 12 r E 11 t F error 10 h G 6 w H 5 q I error 5 a J 4 g K 3 h L 2 t

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft

Re: Top 10 with filter

You can also achieve that in DAX, please refer to the below formula:

`NewTable = TOPN(10,SUMMARIZE(FILTER(SampleTable,FIND("error",SampleTable[Machine],1,0)=0),SampleTable[Machine],"TotalAlarms",SUM(SampleTable[Alarms]) ))`

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Helper III

Re: Top 10 with filter

@Sea_and_Anne : You can remove rows with Machine having "Error" word in Query Editor. Please screen shot.

Since you need only Machine and Alarm , remove Nature column . you will get the result.

Microsoft

Re: Top 10 with filter

You can also achieve that in DAX, please refer to the below formula:

`NewTable = TOPN(10,SUMMARIZE(FILTER(SampleTable,FIND("error",SampleTable[Machine],1,0)=0),SampleTable[Machine],"TotalAlarms",SUM(SampleTable[Alarms]) ))`

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors