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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

IFS in Excel to PowerBI with text strings

Hey there,

 

I need to transform this formula out of excel into PowerBI:

=IFS(AB3="";"N/A";AB3<=(YEAR(TODAY()));"YES";AB3>(YEAR(TODAY()));"NO")

 

My idea is:

In Overhaul Window? RETROFITS = IFERROR(IF([Overhaul Window Start RETROFITS]<=YEAR(NOW()),"YES","NO"),"N/A")
Unfortunately, PowerBI doesn't give back the text string "N/A".
 
How can I give back simple textstrings, if a cell is empty?
It seems to be so easy, but I couldn't figure out how to give back textstrings (BLANK, UPPER, LOWER....)
 
 
11 REPLIES 11
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

If the problem persists,could you share the sample pbix or sample data?

Please mask any sensitive data before uploading

 

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

Anonymous
Not applicable

Hello together,

 

I use a SWITCH TRUE function und receive the error that I have different data formats (True/False and Text) and that I need to transform the data. Here is the code:

 

   
    SWITCH (
    TRUE (),
    Results[In Overhaul Window? RETROFITS] = "NO", "NO",
         Results[In Overhaul Window? RETROFITS] = "YES" && Results[Overhaul already performed? RETROFITS] = FALSE(), "YES",
             Results[In Overhaul Window? RETROFITS] = "YES" && Results[Overhaul already performed? RETROFITS] = TRUE(), "YES",
                Results[Last Service Event Year] + Results[Overhaul Criteria RETROFITS] >= YEAR(TODAY()), "NO","YES", "N/A"

 

I tried to transform the True/False format in a string but it did'nt work.

How can I transform it with VALUE or FORMAT or any other function so that both formats are the same?

Hi @Anonymous ,

 

Think this is the same follow up post.

 

 Share  sample data or screenshot removing all sensitive information

 

Column =
SWITCH (
    TRUE (),
    Results[In Overhaul Window? RETROFITS] = "NO", "NO",
    Results[In Overhaul Window? RETROFITS] = "YES"
        && Results[Overhaul already performed? RETROFITS]
            = FALSE (), "YES",
    Results[In Overhaul Window? RETROFITS] = "YES"
        && Results[Overhaul already performed? RETROFITS]
            = TRUE (), "YES",
    Results[Last Service Event Year] + Results[Overhaul Criteria RETROFITS]
        >= YEAR (
            TODAY ()
        ), "NO",
    "YES"
)

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

@Anonymous , "N/A" is additional

 

SWITCH (
TRUE (),
Results[In Overhaul Window? RETROFITS] = "NO", "NO",
Results[In Overhaul Window? RETROFITS] = "YES" && Results[Overhaul already performed? RETROFITS] = FALSE(), "YES",
Results[In Overhaul Window? RETROFITS] = "YES" && Results[Overhaul already performed? RETROFITS] = TRUE(), "YES",
Results[Last Service Event Year] + Results[Overhaul Criteria RETROFITS] >= YEAR(TODAY()), "NO","YES")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

this doesn't work too because of the formats....

V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Format "Overhaul Window Start RETROFITS" as whole number.

Try this calculated column:

Column = SWITCH(TRUE(),
ISBLANK('Table'[Overhaul Window Start RETROFITS]),"n/a",
'Table'[Overhaul Window Start RETROFITS]>=YEAR(NOW()),"Yes",
'Table'[Overhaul Window Start RETROFITS]<YEAR(NOW()),"No")

If "Overhaul Window Start RETROFITS" is a measure,try create this measure:

Measure 2 = SWITCH(TRUE(),
ISBLANK([Overhaul Window Start RETROFITS]),"N/A",
[Overhaul Window Start RETROFITS]>=YEAR(NOW()),"Yes",
[Overhaul Window Start RETROFITS]<YEAR(NOW()),"No")

 

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

nandukrishnavs
Community Champion
Community Champion

@Anonymous 

 

Try below the DAX in the calculated column

ColumnValue =
VAR __Year =
    IF ( ISERROR ( VALUE ( MyTable[Year] ) ), BLANK (), VALUE ( MyTable[Year] ) )
VAR __Result =
    SWITCH (
        TRUE (),
        ISBLANK ( __Year ), "No",
        __Year <= YEAR ( TODAY () ), "Yes",
        __Year > YEAR ( TODAY () ), "No"
    )
RETURN
    __Result

nandukrishnavs_0-1597652748326.png



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂

 


Regards,
Nandu Krishna

Fowmy
Super User
Super User

@Anonymous 

Try this as a new column:

 

RETROFITS = 
 IF( 
    ISBLANK([Overhaul Window Start RETROFITS]),
    "N/A",
    IF(
        [Overhaul Window Start RETROFITS]<=YEAR(NOW()),
        "YES",
        "NO"
    )
 )

 

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@Anonymous , Something like this.

Switch(True(),

isblank([AB3] , "No",

[AB3] = "NA" , "No"

[AB3] <= year(Today()) &"" ,"Yes",

"No"

)

 

Can you share sample data and sample output in table format?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

HI @Anonymous ,

 

Create a Calculated Column

 

Column =
SWITCH (
    TRUE (),
    'Table'[AB3]
        = BLANK ()
        || 'Table'[AB3] = "", "N/A",
    'Table'[AB3]
        < YEAR (
            TODAY ()
        ), "YES",
    'Table'[AB3]
        > YEAR (
            TODAY ()
        ), "No"
)

 

 

 Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Anonymous
Not applicable

Unfortunately, the code doesn't work.

It replys a wrong syntax

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors