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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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