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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Only show years available in other table

Hi all

 

So i have 2 tables in my case. Table 1 contains data of ~10 years, and Table 2 only since 2018.

Table 2 contains revenue targets, Table 1 is the revenue table. These are connected via an inactive relationship.

This works just fine.

On the page i also have a "Year" slicer, this year comes from table 1, so it shows 2009-2019, but i only want to show years where targets are available, so for this case 2018 & 2019.

 

Wasnt able to create a column that fullfills my need.

 

Many thanks

1 ACCEPTED SOLUTION

can you refer to https://community.powerbi.com/t5/Desktop/DAX-query-to-compare-a-value-in-one-table-to-see-if-it-exis...

Column = CALCULATE(COUNTROWS(Table2);FILTER(Table2;Table2[year]=EARLIER(Table1[year])))>0
after use this formula, you can filter "true" columns

View solution in original post

6 REPLIES 6
mussaenda
Super User
Super User

Have you tried to make the relationship both?

Take note that this can slow down the report.

Thank you

Anonymous
Not applicable

Its already on "Both". Single direction didnt work for me (messes up the report)

 

@Osmanakgunduz  this looks pretty good, im getting small differences in my revenue though... But its possible that this is solveable inside my data.

another option is to drag the taget column your date slicer visual and filter it greater than or is equal to 0.

Osmanakgunduz
Helper I
Helper I

Hello @Anonymous 

 

I suppose you have selected table1 year column in slicer's field. Can you remove this field and drag-drop table2's year column?

 

Best Regards!

 

Anonymous
Not applicable

Yes i already tried that, but its not filtering the revenue correctly this way..

can you refer to https://community.powerbi.com/t5/Desktop/DAX-query-to-compare-a-value-in-one-table-to-see-if-it-exis...

Column = CALCULATE(COUNTROWS(Table2);FILTER(Table2;Table2[year]=EARLIER(Table1[year])))>0
after use this formula, you can filter "true" columns

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.