Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet 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
I have a table which contains a list of employees and when they were active in the field. Simple Branch + Unique Key merged field, then a date slicer filters this to show who worked in the field during any selectable period. How can also show a second table listing the employees that were inactive in the field during this period. I am able to create a measure to give the number, but I would like to list the employees in a table.
I have tried measures and duplicate tables then creating a merged query for those results that don't show in the main table (left ansi) but I got this wrong on how it needs to work. It needs to be dynamic with the date and branch slicers. I hope someone can advise, basically show me the opposite results of another table thats filtered.
Thank you
Solved! Go to Solution.
Hi @Beavertron
I think you want to dynamically get active and inactive employee lists through Date slicer.
Now your problem is that you can't get a list by measure.
Measure will show you aggregate values, so you can't get a list by measure directly.
However you can build a measure to filter your employee list to achieve your goal.
My Sample:
Firstly we need to build a Date table for slicer.
Date =
CALENDAR(MIN('Table'[ActiveDate]),MAX('Table'[ActiveDate]))
Measure:
ActiveFilter =
VAR _Period = VALUES('Date'[Date])
Return
IF(MAX('Table'[ActiveDate]) in _Period,1,0)
Build two emplotyee lists and add this measure into the filter field of two employee lists.
Then set this measure to show items when value =1 in active employee list, set this measure to show items when value =0 in inactive employee list.
You see active will show all employee and inactive will show blank by default.
If we set date between 2021/1/1 to 2021/1/24, result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Beavertron
I think you want to dynamically get active and inactive employee lists through Date slicer.
Now your problem is that you can't get a list by measure.
Measure will show you aggregate values, so you can't get a list by measure directly.
However you can build a measure to filter your employee list to achieve your goal.
My Sample:
Firstly we need to build a Date table for slicer.
Date =
CALENDAR(MIN('Table'[ActiveDate]),MAX('Table'[ActiveDate]))
Measure:
ActiveFilter =
VAR _Period = VALUES('Date'[Date])
Return
IF(MAX('Table'[ActiveDate]) in _Period,1,0)
Build two emplotyee lists and add this measure into the filter field of two employee lists.
Then set this measure to show items when value =1 in active employee list, set this measure to show items when value =0 in inactive employee list.
You see active will show all employee and inactive will show blank by default.
If we set date between 2021/1/1 to 2021/1/24, result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, thank you so much. Being quite new to powerBI I didn't realist that measures could be used in table filters this way. This is incredibly power and handy to know. Many thanks
@Beavertron Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
87 | |
87 | |
67 | |
49 |
User | Count |
---|---|
135 | |
113 | |
100 | |
68 | |
67 |