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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
Community Champion
Community Champion

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!:
DAX For Humans

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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