Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Guys I need IF statement in M based on this example table:
The logic is:
when [Column1]="Value1" or [Column1]="Value2" or [Column1]="Value3" then 1
when [Column1]="Value4" and Date is in current year then 1
else 0
Solved! Go to Solution.
Hi @Anonymous
= if [Column1]="Value1" or [Column1]="Value2" or [Column1]="Value3" then 1
else if [Column1]="Value4" and Date.Year([Date]) = Date.Year(DateTime.LocalNow()) then 1
else 0
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi @Anonymous
= if [Column1]="Value1" or [Column1]="Value2" or [Column1]="Value3" then 1
else if [Column1]="Value4" and Date.Year([Date]) = Date.Year(DateTime.LocalNow()) then 1
else 0
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
7 | |
7 | |
6 | |
6 |