Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I am having an issue with a model. I have five tables that need to be linked using an ID, which works fine. But in addition, I would like to have a general Date filter that filters all those five tables at once.
Note that I can't create a second relationship using the Date columns, because I need my ID relationships to go both ways. The second relationship creates ambiguity. Here is the model:
An advice I got was to filter dates in every measure I create using DAX. for example:
Does anyone know a way to get around this problem?
Thanks a lot, and happy new year.
Solved! Go to Solution.
Hi @Anonymous ,
According to my understanding, you want to use Date for Slicer to filter all other tables when there are relationships among the other tables but no between Date table and the others, right?
Please try to use the following formula and then apply it(set as "is 1") to all visuals:
Measure =
VAR _min =
MIN ( 'Date'[Date] )
VAR _max =
MAX ( 'Date'[Date] )
VAR _idTab1 =
SUMMARIZE (
FILTER (
ALL ( 'Table1' ),
MAX ( 'Table1'[Date] ) >= _min
&& MAX ( 'Table1'[Date] ) <= _max
),
[ID]
)
RETURN
IF ( MAX ( 'Fact'[ID] ) IN _idTab1, 1, 0 )
The final output is shown below:
Here is the pbix file.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it.
Best Regards,
Eyelyn Qin
Thanks @Anonymous,
I had to adapt your formula because I want the tables to be each filtered by date, independently of IDs.
So I used this formula as a filter in each visual and it does the job:
Thanks for your replies.
Regards.
Hi @Anonymous ,
According to my understanding, you want to use Date for Slicer to filter all other tables when there are relationships among the other tables but no between Date table and the others, right?
Please try to use the following formula and then apply it(set as "is 1") to all visuals:
Measure =
VAR _min =
MIN ( 'Date'[Date] )
VAR _max =
MAX ( 'Date'[Date] )
VAR _idTab1 =
SUMMARIZE (
FILTER (
ALL ( 'Table1' ),
MAX ( 'Table1'[Date] ) >= _min
&& MAX ( 'Table1'[Date] ) <= _max
),
[ID]
)
RETURN
IF ( MAX ( 'Fact'[ID] ) IN _idTab1, 1, 0 )
The final output is shown below:
Here is the pbix file.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello!
I just stumbled upon the same problem, but sadly cant open the pbix file you attached, I went through the process, used this code as per the last reply :
Thanks a lot !
@Anonymous , Ideally, you should be able to join with date table, all these 5. Make some bi-directional joins as single directional and that will work.
Or try measure like
Distinct.count =
var MinDate = minx(allselected(DateTable), DateTable[Date])
var MaxDate= maxx(allselected(DateTable),DateTable[Date])
var val = values(AsRun[Date])
RETURN
CALCULATE(
DISTINCTCOUNT(AsRun[TV Link]);
Filter(AsRun; AsRun[Date] >= MinDate && AsRun[Date] <= MaxDate))
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
67 | |
51 | |
38 | |
26 |
User | Count |
---|---|
89 | |
52 | |
45 | |
39 | |
38 |