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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
h3x
New Member

IF Row is True display value from Date1 if False display value from Date2

Hello everyone, maybe one of you can help me with this. I have a Table where i need to check a row "category" if it contains certain Values. If one of this Value is True i want to display the value of my Date1 Row if not it need to display the value of the row date2.

 

My Dax Measure looks like this, but i dont know how to display the value from the date rows. Can someone help? Thanks 🙂

 

IF(

CONTAINS('table', 'table'[category], "A") ll

CONTAINS('table', 'table'[category], "B") ll

CONTAINS('table', 'table'[category], "C"),

 

?? DISPLAY DATE1,

 

?? DISPLAY DATE2

)

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @h3x ,

You can create a calculated column as below to get it:

Column = 
IF (
    IFERROR ( SEARCH ( "A", 'Table'[category], 1, 0 ), 0 ) > 0
        || IFERROR ( SEARCH ( "B", 'Table'[category], 1, 0 ), 0 ) > 0
        || IFERROR ( SEARCH ( "C", 'Table'[category], 1, 0 ), 0 ) > 0,
    'Table'[Date1],
    'Table'[Date2]
)

yingyinr_0-1670552675965.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @h3x ,

You can create a calculated column as below to get it:

Column = 
IF (
    IFERROR ( SEARCH ( "A", 'Table'[category], 1, 0 ), 0 ) > 0
        || IFERROR ( SEARCH ( "B", 'Table'[category], 1, 0 ), 0 ) > 0
        || IFERROR ( SEARCH ( "C", 'Table'[category], 1, 0 ), 0 ) > 0,
    'Table'[Date1],
    'Table'[Date2]
)

yingyinr_0-1670552675965.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Worked fine! Thank you very much!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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