Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello all,Greeting,
I have Employee table and Company with are related with Company column.
Employee table:
Company | Employee name | Date of Join |
P1 | Emp1 | 30-Mar-24 |
P1 | Emp2 | 30-Apr-24 |
P1 | Emp9 | 30-May-24 |
P1 | Emp4 | 30-Jun-24 |
P1 | Emp5 | 30-Jul-24 |
P2 | Emp7 | 30-Nov-24 |
P2 | Emp8 | 30-Sep-24 |
P2 | Emp12 | 30-Dec-24 |
P3 | Emp21 | 30-Dec-24 |
P3 | Emp22 | 30-Jan-25 |
P3 | Emp23 | 25-Feb-25 |
P3 | Emp29 | 26-Mar-25 |
P3 | Emp25 | 07-Apr-25 |
and Compnay table:
Company |
P1 |
P2 |
and also Employee table is related with Calendar table via Date of Join. I have Month slicer(single select) from Calendar Table in my report. Month slicer:
Requirements: I want to get table with Project name and the all Employee name who join between dates Date(2024,01,01) and selected date from Slicer. For example when I select Sep 24 from slicer, Result will be:
Company | Employee_ |
P1 | Emp1 |
P1 | Emp2 |
P1 | Emp9 |
P1 | Emp4 |
P1 | Emp5 |
P2 | Emp8 |
I tried to write measure like : Employee_=Calculate(max(employee name),datesbetween(Calendar[date],Date(2024,01,01),max(calendar[Date])) but thats not work. How can I do using DAX.
Could you please help ?
Hi @Jyaul1122 ,
Here is the measure for your required output.
Show Employees =
VAR SelectedDate = MAX('Calendar'[Date])
RETURN
IF(
'Employee'[Date of Join] >= DATE(2024, 1, 1) &&
'Employee'[Date of Join] <= SelectedDate,
1,
0
)
Add Company and Employee name to a table visual, then apply the Show Employees measure as a filter where the value equals 1. This will display only rows that satisfy the condition without aggregating the names.
Best regards,
Thanks for your reply, I can not apply filter because I have a lot off measures and fields in table visual. Filter will impact to another measures also.
Use the following DAX to define a new measure that checks for employees whose joining date falls in the required range:
If you want to ensure the table filters correctly when you select a month in the slicer, Power BI's relationship between the Calendar table and the Employee table will take care of the filtering.
When you select September 2024 in the slicer, the table will display:
Company Employee nameP1 | Emp1 |
P1 | Emp2 |
P1 | Emp9 |
P1 | Emp4 |
P1 | Emp5 |
P2 | Emp8 |
Let me know if you need further clarification or adjustments!
I tried with your idea but I got single value on Sep 24, P2 Emp 8.
I thinks , its filter rows based on Month selection. I also tried with remove relation between calendar table but got error: A table of multiple values was supplied where a single value was expected.
If you have pbix please share.
Thank you for the clarification. The issue lies with the filtering behavior. Since the slicer is single-select and filters the data to a single date (or month), we need to modify the approach slightly. Here is a correct DAX solution to achieve your goal without breaking relationships.
This creates a calculated table in your model.
If you want to display this dynamically in an existing table visual:
If your slicer filters the Employee table directly due to relationships, try removing the slicer impact on the Employee table:
This measure ignores slicer filters and manually applies conditions.
Once you apply the solutions:
P1 | Emp1 |
P1 | Emp2 |
P1 | Emp9 |
P1 | Emp4 |
P1 | Emp5 |
P2 | Emp8 |
Let me know if you'd like me to create and share a sample PBIX file! 🚀
Its not working , same result as previous. Could you please share pbix ?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
76 | |
55 | |
35 | |
34 |
User | Count |
---|---|
99 | |
56 | |
53 | |
44 | |
40 |