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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Vani1987
New Member

How to give below condition in power BI

Hi Team,
developing qlik report to power Bi how to give below condition in power BI, can anyone help me on this

if(isnull(contractcreateddate) or contractcreateddate='NULL' or contractcreateddate='' or contractcreateddate='n/a','N/A',
'FY' & if(Month(DATE(contractcreateddate))>=9 and Month(DATE(contractcreateddate))<=12, right(Year(contractcreateddate)+1,2), right(Year(contractcreateddate),2))) as "Contract Start FY",

4 REPLIES 4
Anonymous
Not applicable

Hi @Vani1987 ,

 

To achieve the condition you mentioned in Power Query using M language, you can try the following:

 

if [contractcreateddate] = null or [contractcreateddate] = "NULL" or [contractcreateddate] = "" or [contractcreateddate] = "n/a" then "N/A" else "FY" & if Date.Month([contractcreateddate]) >= 9 and Date.Month([contractcreateddate]) <= 12 then Text.End(Text.From(Date.Year([contractcreateddate]) + 1), 2) else Text.End(Text.From(Date.Year([contractcreateddate])), 2)

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Vani1987
New Member

the above logic is not working, here 2 if conditions are there also isnull taking as column in power BI, also  Month(DATE(contractcreateddate) 1st it has to extract month and then checking the condition, but in power BI if(Month taking as a column so throughing error, can any once help me to achive this

if(isnull(contractcreateddate) or contractcreateddate='NULL' or contractcreateddate='' or contractcreateddate='n/a','N/A', 'FY'

&

if(Month(DATE(contractcreateddate))>=9 and Month(DATE(contractcreateddate))<=12, right(Year(contractcreateddate)+1,2), right(Year(contractcreateddate),2))) as "Contract Start FY",

Hi @Vani1987 

Please create sample pbix file with same column you have and share the google drive link here, give access to all




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





PijushRoy
Super User
Super User

Hi @Vani1987 

Create a custom column and try this syntax, please follow the pattern

= if [contractcreateddate]="null" OR [contractcreateddate]="null" OR [contractcreateddate]="null" OR 
[contractcreateddate]="n/a" then "N/A" else if (your second condition) then (your second output) else (final output)

Where you have column reference, please drag from Column available in right side window by double clicking.

PijushRoy_0-1697786270747.png

 

PijushRoy_1-1697786301010.png


If my comment helps you, please hit 👍

If solve your requirement, please mark as SOLUTION




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Kudoed Authors