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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Filter with dates of two different tables

Hello.

Apparently simple problem:

I have two tables. One for year 2018, another for year 2019, and I can link them by zone. 

Zone Date
A01/02/2018
B 
C 

 

ZoneDate
A01/02/2019
B02/02/2019
C 

 

So, in this case, I want to know wich of my zones have no information (zone C) on the Date row, on both, the 2018 and 2019 tables.

I can filter get a filter with Year: 2018, 2019 and Null, but I can only get it to filter one of the tables, not both.

Thank you,
Carlos Soares

 

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

Hi @Anonymous 

You could append queries to one query,

Capture9.JPG

Then create measures

countall = CALCULATE(COUNTA(Append1[Date]),ALLEXCEPT(Append1,Append1[Zone]))

countblank = CALCULATE(COUNTBLANK(Append1[Date]),ALLEXCEPT(Append1,Append1[Zone]))

isblank = IF([countall]-[countblank]=0,"no information","has infor")

Capture10.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
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-juanli-msft
Community Support
Community Support

Hi @Anonymous 

You could append queries to one query,

Capture9.JPG

Then create measures

countall = CALCULATE(COUNTA(Append1[Date]),ALLEXCEPT(Append1,Append1[Zone]))

countblank = CALCULATE(COUNTBLANK(Append1[Date]),ALLEXCEPT(Append1,Append1[Zone]))

isblank = IF([countall]-[countblank]=0,"no information","has infor")

Capture10.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

az38
Community Champion
Community Champion

Hi @Anonymous 

you can try a new calculated table, but its not a Power Query, its a DAX solution

Table = 
FILTER(
ADDCOLUMNS(
UNION(
DISTINCT(Table2018[Zone]),
DISTINCT(Table2019[Zone])
),
"Count",
CALCULATE(COUNTROWS(Table2018),Table2018[Zone]=EARLIER([Zone]),NOT(ISBLANK(Table2018[Date]))) + CALCULATE(COUNTROWS(Table2018),Table2019[Zone]=EARLIER([Zone]),NOT(ISBLANK(Table2019[Date])))
),
[Count] < 1)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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