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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
sree13579
New Member

Conditional formatting for power query

I am trying to write a conditional column as below:

if([Final Bucket Ids]<>[Initial Bucket Id] && List.ContainsAny([Final Bucket Ids],'440','441','442','443'),1,0)

My goal is if the value in Final Bucket id is NOT equal to value in Initial Bucket id AND if the Final bucket ID is any of the following IDs - 440,441,442,443, then return me 1 else 0

Can you please help

9 REPLIES 9
v-mdharahman
Community Support
Community Support

Hi @sree13579,

Thanks for reaching out to the Microsoft fabric community forum.

It looks like you are looking for a way to calculate if the value in Final Bucket ID is notequal to value in Initial Bucket ID and if the Final bucket ID is any of the mentioned IDs. As @the_BI_buddy and @ZhangKun both responded to your query, please go through their responses and check if it solves your issue.

 

I would also take a moment to thank @the_BI_buddy and @ZhangKun, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

If this post helps then please mark it as a solution, so that other members find it more quickly.

Thank you.

the_BI_buddy
Frequent Visitor

Try:
if Text.Lower([Final Bucket Ids]) <> Text.Lower([Initial Bucket Id]) and
List.Contains({440, 441, 442, 443}, [Final Bucket Ids])
then 1
else 0

Note: Power Query is case-sensitive, so it's always a good idea to validate the data before applying transformations.

Thank you for helping me learn power BI query , this is also super helpful

Thank you, glad know this.
If this resolves your issue, you can please mark it as a solution.

Hi @sree13579,

Just following up to your previous message, I'd like to confirm if you've successfully resolved this issue or if you need further help.

If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.


If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.

Hi @sree13579,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.


Thank you.

Hi @sree13579,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

ZhangKun
Super User
Super User

if [Final Bucket Ids]<>[Initial Bucket Id] and List.ContainsAny([Final Bucket Ids], {"440","441","442","443"}) then 1 else 0

Thank you so much! Super helpful!

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors