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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Charu
Post Patron
Post Patron

How to show all the values based on If condition in power bi desktop

Dear Communtiy,

 

I'm trying to show all the values which satisfies the condition,but I could only see single value.

 

Please help me with the DAX formula.

 

Below is the formula I have tried but it's showing all the values not working based on condition

 
Measure = 
VAR NOTETXT = IF('table'[Variance %] > 0,CONCATENATEX(('table'),'table'[Category],"AND"))
VAR pretext = " Following Category ' "
VAR postcat = " 'achieved target"

RETURN pretext & NOTETXT & postcat
 
Below is returning single value
_vm target =
VAR NOTETXT = IF('table'[Variance %] > 0,'table'[Category])
VAR pretext = " Following Category ' "
VAR postcat = " 'achieved target"

RETURN pretext & NOTETXT & postcat
 
 
Below are the Sample data
Variance%  category  
-6.5%         CategoryA
-5.3%         CategoryB
9.3%          CategoryC
7.3%          CategoryD
 
Expected result is  : Following Category ' CategoryC AND CategoryD' achieved  target
1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @Charu ,

 

Your table filter need to be configured as "'Table'[Variance%]>0" like the following measure.

Measure =
VAR NOTETXT =
    CONCATENATEX (
        FILTER ( 'Table', 'Table'[Variance%] > 0 ),
        'table'[Category],
        " AND "
    )
VAR pretext = " Following Category ' "
VAR postcat = " 'achieved target"
RETURN
    pretext & NOTETXT & postcat

Here is the result.

1-1.PNG

 

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

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @Charu ,

 

Your table filter need to be configured as "'Table'[Variance%]>0" like the following measure.

Measure =
VAR NOTETXT =
    CONCATENATEX (
        FILTER ( 'Table', 'Table'[Variance%] > 0 ),
        'table'[Category],
        " AND "
    )
VAR pretext = " Following Category ' "
VAR postcat = " 'achieved target"
RETURN
    pretext & NOTETXT & postcat

Here is the result.

1-1.PNG

 

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

Hi @v-eachen-msft,

 

Thanks a lot your solution worked well.Thanks once again for this timely help 🙂

Greg_Deckler
Super User
Super User

Tough to tell what is going on, sample data and expected result would help. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 

 

I did edit my post with sample data and the expected result.Hope this make sense.Please help me achieve the expected result.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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