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
hlynurgudna
Frequent Visitor

Measure that checks if values from table is equal to another table

Hi 

 

I have a problem that I cant seem to figure out how to solve, have been browsing through this forum and I cant find anything that works for me

I want to create a measure "X" that gives me 1 or 0 depending if two conditions are met

 

I have a "Letter Code" which is from Table1, "Type" & "Doc exp" from Table2 and Date from Date table.
Measure2 and Measure3 show a specific date when an event occurs

 

hlynurgudna_4-1643144347972.png

 

On top of that I also have Activity from Table3

 

hlynurgudna_3-1643143992968.png

 

What I want to be able to give the measure the value 1 if Table1[Type] is equal to Table3[Activity], and the Date of that activity is before the date on Measure2&3
By doing that I could then filter out measure2&3 out of the upper table so it wouldnt appear

The data is in a cube so I am not able to easily modify the data

 

Hope I made myself clear enough

 

Best regards

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, 

According to your description, I can roughly understand your requirement, I think you can try this measure to achieve your needs:

This is the test data I created based on your description:

vrobertqmsft_0-1643357053658.png

vrobertqmsft_1-1643357053660.png

Measure =

IF(MAX('Table1'[Type])=MAX('Table3'[Activity])&&MAX('Table3'[Date])<=[Measure2]&&MAX('Table3'[Date])<=[Measure3],1,0)

 

And you can create a table chart to place it like this to get what you want:

vrobertqmsft_2-1643357053664.png

 

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, 

According to your description, I can roughly understand your requirement, I think you can try this measure to achieve your needs:

This is the test data I created based on your description:

vrobertqmsft_0-1643357053658.png

vrobertqmsft_1-1643357053660.png

Measure =

IF(MAX('Table1'[Type])=MAX('Table3'[Activity])&&MAX('Table3'[Date])<=[Measure2]&&MAX('Table3'[Date])<=[Measure3],1,0)

 

And you can create a table chart to place it like this to get what you want:

vrobertqmsft_2-1643357053664.png

 

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

hlynurgudna
Frequent Visitor

I think this is what I am trying to do, but I need to do this in a measure, not by adding a column 

Column = IF(Table1[Country]&Table1[Currency]=Table1[Country]&RELATED(Table2[Currnecy]),"Government Bond","Coprorate Bond")

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.

Top Solution Authors