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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Ignore Dimension Value in DAX Expression

Dear Community,

I am having difficulty writing a DAX expression, trying to calculate a percentage in a bar graph.

 

Expression=

CALCULATE(COUNT('Data'[RESPONDENT_ID]), FILTER('Data','Data'[QUESTION_ID] = 2  && 'Data'[Flag]="Y"))

/

CALCULATE(COUNT('Data'[RESPONDENT_ID]), FILTER('Data','Data'[QUESTION_ID] = 2  && 'Data'[Flag]="Y"))

 

In the second expression I have to take total count to get the percentage, i want to ignore the dimension in the second expression.

 

My dimension Field name is [Answer], i will considers all other filters applied but want to ignore the dimension value. it should be very simple, In Qlik we can use TOTAL keyword to achieve the same.

i have just one table in the data model.

 

 

your help will be highly apprecitade.

Many Thnaks.

Khan

1 ACCEPTED SOLUTION

@Anonymous 

Did you try ALLSELECTED ?

Please share a screenshot of the visual and some sample data if possible.

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube, LinkedIn

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

View solution in original post

5 REPLIES 5
Fowmy
Super User
Super User

@Anonymous 

I have not seen your data table but apply as below. Use ALL or ALLSELECTED  around the 2nd filter

Expression=

CALCULATE(COUNT('Data'[RESPONDENT_ID]), FILTER('Data','Data'[QUESTION_ID] = 2  && 'Data'[Flag]="Y"))

/

CALCULATE(COUNT('Data'[RESPONDENT_ID]), FILTER(ALL('Data'),'Data'[QUESTION_ID] = 2  && 'Data'[Flag]="Y"))


________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube, LinkedIn

 

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

Anonymous
Not applicable

Dear @Fowmy 

Thanks for your comment. i tried your proposed solution, but when i use ALL Keyword as below.

Expression= CALCULATE(COUNT('Data'[RESPONDENT_ID]), FILTER(ALL('Data'),'Data'[QUESTION_ID] = 2  && 'Data'[Flag]="Y"))
it also ignores my fileter Data'[QUESTION_ID] = 2  && 'Data'[Flag]="Y")) which is after the ALL keyword.
 
but i want to consider that filter. Data'[QUESTION_ID] = 2  && 'Data'[Flag]="Y"))

@Anonymous 

Did you try ALLSELECTED ?

Please share a screenshot of the visual and some sample data if possible.

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube, LinkedIn

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

Anonymous
Not applicable

Dear @Fowmy 

 

ALLSELECTED  WORKED..!

 

Thanks A lot.  🙂

Great !

Appreciate it if you could you 👍 my replies.


________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube, LinkedIn

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!