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
l0ll0
New Member

Create measure referencing columns from different non-related tables

Hi everybody!

My model is composed of 2 fact tables, 3 dimensions tables related among them, 1 calendar table.
The relationships are eefined ad in the picture:

l0ll0_0-1670585626472.png

I need to create this matrix visualization:

  • in columns there are 3 fields taken from AREA_DELIVERY and STORE_DELIVERY
  • in rows there is filed d_date from CALENDAR

Inside such matrix a measue has to return BLANK() if the date is before or equal to a specific date. the logic I used is the follwoing:

 

 

logic_blank_dates = 
IF(
    MAX('CALENDAR'[d_date]) <= TODAY(),
    BLANK(),
    1
)

 

 

But it does not work, as it brakes the context showing inconsistent results and all the combination of the three fileds, ignoring any filter applied from outside.

When the measure is inside the viz it works properly identifying the date in the row, but at the same time the measurehas to relate it with the fields in the columns of the matrix. Since the tables of the fields in the columns are not related to the CALENDAR the measure returns an incorrect result.
Is there a way to fix this inside a measure?

Thanks a lot!

2 REPLIES 2
ThomasWeppler
Skilled Sharer
Skilled Sharer

Hi I0II0

When I look at you data model it looks like your calender table and your  AREA_DELIVERY and STORE_DELIVERY table are not connected.
I know this might be a stupid question, but have you tried to connect the two tables?

Thanks  @ThomasWeppler  for answering!

Definitely not a stupid question! There is no way to connect them, because CALENDAR has only dates-related dimension, while AREA_DELIVERY and STRORE_DELIVERY have sales-related dimensions and no dates are involved. 

I tried all the functions that could be useful to avoid the filtering from the columns ( ALL(), REMOVEFILTERS() .... ) but nothing works as well.

Thanks a lot

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.