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
silvias
Helper I
Helper I

Exclude column of TOP N filter or make constant

Good afternoon,

I have a problem. I need to have in one table the number of episodes per problem, in another the total number of episodes and in another the %. (There are more than 3 rows), so the total is 9508.

silvias_0-1598522408070.png

That´s right.

 

The problem is when I filter doing TOP 10 per PROBLEMA_DESC: Since I have now 10 rows instead the 15 that I had in the past, the total number of episodis change to 6690 so percentages change as well.

silvias_1-1598522589622.png

Num_Episodis = COUNTROWS(SUMMARIZE('Table1,'Table1'[EPISODI],'Table1'[PROBLEMA_DESC],'Table1'[PROBLEMA_CODI]))

NF_Num_Episodis = CALCULATE(COUNTROWS((SUMMARIZE('Table1','Table1'[EPISODI],'Table1'[PROBLEMA_DESC]))), ALLSELECTED('Table1'))

%_Episodis = [Num_Episodis]/[NF_Num_Episodis]

 

I don´t know how to have a column that doesn´t work with the TOP N filter. I tried with ALLEXCEPT, ALL... but it doesn´t work and I'm not sure if that´s is possible or do a constant.

 

Thank you in advance.

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

@silvias - Yeah, it's a pain and annoying really. ALL is documented as removing all filters but then it doesn't if you use the Filters pane. I wish it wasn't like that.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

@silvias - If you are doing a filter in the Filter pane, then that pre-filters the data such that DAX calculations lose access to the raw data that is filtered and thus ALL, etc. will not be able to "bring those rows back" so to speak. Are you using a page filter?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler , thank you for your answer.

 

I'm using the TOP N filter in the visualization:

silvias_0-1598526521308.png

 

@silvias - If it is in the Filter pane, it is going to pre-filter the data such that the DAX does not have access to the filtered data and there is no getting around it. This has come up before in other threads and to the best of my knowledge there is no work-a-round. 

 

Seems like @Pragati11 was headed down the same path.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_DecklerThank you, Greg.

I guess I'll have to show all the values without TOP 10 if I want to be shown all of them. Thank you!

@silvias - Yeah, it's a pain and annoying really. ALL is documented as removing all filters but then it doesn't if you use the Filters pane. I wish it wasn't like that.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Pragati11
Super User
Super User

Hi @silvias ,

 

Just want to check how you are using TOPN filter on this visual?

  1. Are you putting a Top N filter on your visual only from FILTER PANE?
  2. Are you using a Top N slicer at the top?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi @Pragati11

 

thank you for your answer. I'm putting the Top N filter on my visual only from FILTER PANE:

 
 
 

Captura.PNG

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.