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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
JaipalAnu
Helper III
Helper III

Need help in if and else condition in Query editor

Hello Everyone,

 

I have a field with the Name ConfigType and it has two values "CapEX" & "RBA", so I'm applying one condtion in the Power Query with the IF logic to get the CAP & COR. But the condition is added only for CapEX but not for RBA.
As per the logic when i use ConfigType and ConfigSubType in same slicer, It is showing Cap & COR for both Capex and RBA. It should show only for Capex not for RBA. The logic is below.

Please help

ConfigSbTYpe = if[ConfigType] = "CapEx" and [L1 Grouping]="AMI" then "CAP"
else if [ConfigType] = "CapEx" and [L2 Grouping]="AGR" then "COR"
else if [ConfigType] = "CapEx" and [L3 Grouping]="AGR" then "COR"
else "CAP"

JaipalAnu_0-1694584272314.png

The CAP & COR should show only for Capex not for RBA, Please help.

@parry2k , @des  @PPRO , @Microsoft 

 




1 ACCEPTED SOLUTION

Then simply replace the null with ConfigSubtype.

You just need to provide a condition to the RBA so it will not take CAP

 

 

View solution in original post

3 REPLIES 3
JaipalAnu
Helper III
Helper III

Thanks for you reply @mussaenda 
If i give condition like if ConfigType is RBA then null else CAP

So, here I'm loosing RBA value also, i should not loose that, RBA has to show but in the dropdown CAP has to not show for RBA.

mussaenda
Super User
Super User

Hi @JaipalAnu ,

 

it is because of you else in the end. 

you should put another condition like if ConfigType is RBA then null else CAP

 

or 

at the end of your statement before else, 

you can insert like if ConfigType is Capex then CAP else null

 

 

Then simply replace the null with ConfigSubtype.

You just need to provide a condition to the RBA so it will not take CAP

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.

June 2025 community update carousel

Fabric Community Update - June 2025

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