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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pricey79
Helper V
Helper V

Help with If statement (I think) please

Hello, I was hoping someone could help please

 

I have two tables and a due date for a record. The record is in both tables. I would like to present ther record in one visual with one of the two due dates (date 1 and date 2). The trouble I have is, if date1 is before a date in another column in another table, i'd like it to be date1,  but if the date is after or equal to date 2, i'd like it to be date 2.

 

I hope I've explained that well enough

 

How would I go about this please?

 

Thank you for any help

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file whether it suits your requirement.

 

 

Jihwan_Kim_1-1667918193912.png

 

Jihwan_Kim_0-1667918171308.png

 

 

Record measure: = 
IF (
    HASONEVALUE ( 'ID'[ID] ),
    MIN ( MAX ( 'Table One'[Date one] ), MAX ( 'Table Two'[Date two] ) )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file whether it suits your requirement.

 

 

Jihwan_Kim_1-1667918193912.png

 

Jihwan_Kim_0-1667918171308.png

 

 

Record measure: = 
IF (
    HASONEVALUE ( 'ID'[ID] ),
    MIN ( MAX ( 'Table One'[Date one] ), MAX ( 'Table Two'[Date two] ) )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


@Jihwan_Kim Thank you

Gengar
Resolver I
Resolver I

Hi @Pricey79 ,

 

IF(MAX('Table1'[Date1])<MAX('Tbale2'[Date2],MAX('Table1'[Date1]),MAX('Tbale2'[Date2])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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