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.
I have a table that has the bellow fields:
Project Name
Start Date
Completion Date
I want to have a visual table that has those three fields, this is quite easy to do.
But I also want to filter that table by both the Start Date and the Completion Date. I want to be able to select a date range and the table will show me all the projects that either the Start or the Completion Date are within the date range I selected.
I tried creating a datetable and relating both the Start Date and the Completion Date with that datetable but powerbi allows only one of the relationships to be active.
How can I achieve what I want?
Hi,
You could create the create the date table but without a relationship at all.
That way you could adjust the filter context of the measure accordingly.
For example to get a count of all projects of which at least one day crosses your date range filtered on the data table:
ProjectsCrossingDates := CALCULATE ( COUNTROWS ( 'ProjectTable' ), FILTER ( 'ProjectTable', [Start Date] <= MAX ( DateTable[Date] ) && [Completion Date] >= MIN ( DateTable[Date] ) ) )
Note that having no active relationship to date requires that all measures requring time intelligence need to manually filtered in the way in which you expect them to react to the users date selections.
Hope this helps.
Thomas
1. For this case u have to duplicate the table and create two relationship one for start Date and another one for completion date.
2. one more way is using Userelationship function in calculations .
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |