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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
harib
Post Patron
Post Patron

IF conditional column

Hello Friends,

 

I want a conditional column in my table report like if condition or anything 

I have a 3 groups like BG, CMT, Country groups (column wise)

I would like to apply TARGET_PERCENT or TARGET_PERCENT_BG to BG group and CMT group

 

Formula logic 

Target=If (Query1[BG group] Or Query1[CMT group]) Then
If IsNull([Target Percent BG]) Or [Target Percent BG]=0 Then 80 Else [Target Percent BG]
Else
If IsNull([Target Percent]) Or [Target Percent]=0 Then 80 Else [Target Percent]

but it's not working

 

Can anyone give me the output based on above logic

i need a Output like below image

  • if i display Bg group or CMT group in table  TARGET (Calculated column)should come 
  • If i display Country group in table default value of Target Percent BG should come

3.PNG

 

Sample table link

 

https://drive.google.com/file/d/1a70xCMB8x76TvOnURqG20HCGYdgZuKJw/view?usp=sharing

 

 

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @harib ,

 

Try this one.

Target =
VAR a =
    IF (
        ISBLANK ( [Target Percent BG] )
            || [Target Percent BG] = 0,
        80,
        [Target Percent BG]
    )
VAR b =
    IF (
        ISBLANK ( [Target Percent] )
            || [Target Percent] = 0,
        80,
        [Target Percent]
    )
RETURN
    a + b
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

@v-frfei-msft 

 

Hi it's giving aggreagate value like below image, it should show only 1 value either 80 (or) Target Percent BG (or)  Target Percent table values.

You have not mentioned any group in the formula if i'm not wrong

4.PNG

 

Thanks for appriciate if you can provide best solution

parry2k
Super User
Super User

@harib what is this condition:

 

If (Query1[BG] Or Query1[CMT]) 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 

 

We are migrating the reports from one platform to PowerBI. SO they have used fomula like that. Can we get output with our Dax logics instead of following their logic





My project struck here. Help me 

 

Thanks 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.