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
KatieH
Advocate IV
Advocate IV

IF measures on text fields

Hi - looking for some more help!

 

I have 2 tables linked in a many to one relationship.

 

The first is a master tableshowing all sites.

The second is a table showing site orders for the previous year.

 

I have a field in both tables showing the "site status". The second table has the most up to date information regarding site information but it only shows orders that have ordered in the last 12 months.

 

I am building a table/matrix that shows all the sites and would like it to show the site status from table 2 unless that is blank in which case it should show the site status from table 1. Am I missing something really obvious here as I can't figure out how to do it!

 

Thank you! 

1 ACCEPTED SOLUTION

Measure10 = IF(ISBLANK(MAX([Value])),LOOKUPVALUE(IDValues[Value],IDValues[Date],MAX(IDValues[Date])),MAX([Value]))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
v-yuezhe-msft
Employee
Employee

@KatieH,

Do you get expected result after using smoupre's DAX? If not, please share dummy data of the two tables for us to analyze.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

So which way is the many to one?

 

table1 1-* table2

 

or

 

table1 *-1 table1


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler,

 

it's the first one:

 

table1 1-* table2

 

Thanks,

Measure10 = IF(ISBLANK(MAX([Value])),LOOKUPVALUE(IDValues[Value],IDValues[Date],MAX(IDValues[Date])),MAX([Value]))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler,

 

I couldn't quite get the lookupvalue to work but I got round it using the MAX calculations.

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.