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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
DaniloTavecchio
Frequent Visitor

2 tables merged in a new one: how to filter it using a measure from a third table?

Hi all,

Situation: I have a business table, 'ATRSHRP', updated daily that contains rows with a transaction date in it and I have my 'CALENDAR' Table (from 1/1/2023 up to 31/12/2029).

Requirement: I want to know if in this business table there are some dates with no transactions at all: it is an error I have to detect.

 

My Solution: I have merged the calendar table and the business table so that I keep all the dates present in the CALENDAR but (excluding) the dates that has rows in the ATRSHRP. 

 

PS Maybe this is not the easiest solution and the Calendar table is not really needed, any different solution is more then welcomed

 

= Table.NestedJoin(Calendar, {"Date"}, ATRSHRP, {"Data Elaborazione check"}, "ATRSHRP", JoinKind.LeftAnti)

 

Unfortunately the merged table 'DATI MANCANTI' will show me also the dates in the future or in the past; in other words is showing me dates before the minumum date and after the maximum date of 'ATRSHRP'. I have built two measures:

MaxDateCheck and MinDateCheck but I do not know how to use them to filter 'DATE MANCANTI'

 

thanks in advance

2 ACCEPTED SOLUTIONS
AnalyticPulse
Super User
Super User

hello @DaniloTavecchio 

Try below dax and let me know if it works:
DATI_MANCANTI =
VAR MinDateCheck = CALCULATE(MIN('ATRSHRP'[Data Elaborazione check]))
VAR MaxDateCheck = CALCULATE(MAX('ATRSHRP'[Data Elaborazione check]))
RETURN
FILTER(
CALENDAR,
CALENDAR[Date] >= MinDateCheck &&
CALENDAR[Date] <= MaxDateCheck &&
NOT CALENDAR[Date] IN
SELECTCOLUMNS('ATRSHRP', "Date", 'ATRSHRP'[Data Elaborazione check])
)

 

 

Learn Power BI free:

https://analyticpulse.blogspot.com

Learn Power BI free

Powerbi Visualisation

 

AnalyticPulse_0-1715829624787.png

 

 

View solution in original post

DaniloTavecchio
Frequent Visitor

Thanks a lot, it works perfecty !!!

Danilo

View solution in original post

2 REPLIES 2
DaniloTavecchio
Frequent Visitor

Thanks a lot, it works perfecty !!!

Danilo

AnalyticPulse
Super User
Super User

hello @DaniloTavecchio 

Try below dax and let me know if it works:
DATI_MANCANTI =
VAR MinDateCheck = CALCULATE(MIN('ATRSHRP'[Data Elaborazione check]))
VAR MaxDateCheck = CALCULATE(MAX('ATRSHRP'[Data Elaborazione check]))
RETURN
FILTER(
CALENDAR,
CALENDAR[Date] >= MinDateCheck &&
CALENDAR[Date] <= MaxDateCheck &&
NOT CALENDAR[Date] IN
SELECTCOLUMNS('ATRSHRP', "Date", 'ATRSHRP'[Data Elaborazione check])
)

 

 

Learn Power BI free:

https://analyticpulse.blogspot.com

Learn Power BI free

Powerbi Visualisation

 

AnalyticPulse_0-1715829624787.png

 

 

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.

Top Solution Authors