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
Anonymous
Not applicable

New Column IF AND

Hi All,

I am trying to make a new column for the following logic;

IF Policy Period <= 90 day and % Turn Over >30% then true else false.

 

 

Measures:

% Turn Over Limit = DIVIDE([Available Limit]/[Annual Limit],0)

Available Limit = SUM(DOCWA_Perpetual_Eligibilities[Available_Annual_Limit])
Annual Limit = SUM(DOCWA_Perpetual_Eligibilities[ANNUAL_LIM])
 
*tried making a measure for policy period using datediff but you can't reference the column 
DOCWA_Perpetual_Eligibilities[DATE_INCEPT] as its not a single value
Column
Period Policy = Date.Day([DATE_INCEPT]) or numbers of days since column, DOCWA_Perpetual_Eligibilities[DATE_INCEPT]
 
If this can be done via a measure then great but I have tried creating a custom column.
 
Attempt 1

IF (

       ([Available_Annual_Limit]/[ANNUAL_LIM])*100) >=30 &&

       Duration.Days(Duration.From(TODAY()-[DATE_INCEPT])

        ) <= 90,

       true, false

    )

Attempt 2

IF(

    AND(

              AND(Duration.Days(Duration.From(TODAY()-[DATE_INCEPT])) <= 90)[Available_Annual_Limit]/[ANNUAL_LIM])*100)                             >=30),

      "True","False"

 

I am stuck and not sure how to approach this so any help would be appreciated.

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Try to  create calculated column as below

 

New column=if(

   ([Available_Annual_Limit]/[ANNUAL_LIM])*100) >=30 &&

Datediff(Max(DOCWA_Perpetual_Eligibilities[DATE_INCEPT]),today(),Days) <=90,TRUE,FALSE)

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Try to  create calculated column as below

 

New column=if(

   ([Available_Annual_Limit]/[ANNUAL_LIM])*100) >=30 &&

Datediff(Max(DOCWA_Perpetual_Eligibilities[DATE_INCEPT]),today(),Days) <=90,TRUE,FALSE)

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

az38
Community Champion
Community Champion

Hi @Anonymous 

i think you'va got a completely wrong format if-statement for power query. try smth like this

= IF 
   ([Available_Annual_Limit]/[ANNUAL_LIM])*100 >=30 &&
   Duration.Days(Duration.From(DateTime.LocalNow()-[DATE_INCEPT])) <= 90

then true
else false   

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Thanks for the reply but I am getting a token Literal error.

 

 

token.JPG

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.