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
EnterThaBoyd
New Member

Filtering a table based on different columns

Hello! I'm trying to make a report/visual aid to assist in personnel training. They have been tracking everything in excel, and want a better way to show bosses how good or bad we are doing in complying. 

Here is what my data looks like:

  Personnel    Training1  Training 2    Training 3  
  John Doe    1/1/20241/2/2023    1/3/2022  
  Jane Doe      1/1/2024  1/2/2024    8/8/2024  

The table went wonky, i can rewrite if it doesnt make sense

(For simplicity of example: assume training is annual, so John would be overdue for Training 2&3)

So far I already have calculation columns and measures to help me with some donut graphs (x% g2g, y% overdue, that kind of thing.)

# Column
IsTraining1Current =
IF('dataset'[Training 1] >= TODAY() - 365, 1, 0)

# Measure
Remainder Training 1 = COUNT('dataset'[Personnel ]) - SUM('dataset'[IsTraining1Current])


What I would love to do is be able to select each training in a slicer, and then have a single column of personnel who still need to get their training done. 

So for example if I select "Training 3" in a slicer, it would filter the above table and only display "John Doe", since his training is over a year old. 

If anyone could at least point me in the right direction, that would be wonderful.

1 ACCEPTED SOLUTION

Hi @EnterThaBoyd 
If you add columns you should select all of them except for training dates before unpivot.

Ritaf1983_0-1723259156110.pngRitaf1983_1-1723259198090.pngRitaf1983_2-1723259213992.png

The updated pbix is attached

If this post helped, please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @EnterThaBoyd 
You can apply these steps to achieve the desired goal :
1. unpivot the table from PQ:

Ritaf1983_0-1723204440913.png

2. Rename the columns to the normal names 🙂

Ritaf1983_1-1723204531374.png

3. After closing and applying create a measure :

Training test = if (max('Table'[Date])<=TODAY()-365,1,0)
Ritaf1983_2-1723204590856.png

4. Create the slicer for the training and the wanted table + filter the table by the test measure 

Ritaf1983_3-1723204710488.png

Result :

Ritaf1983_4-1723204748998.pngRitaf1983_5-1723204769591.png

The pbix with the example is attached

If previous post helped, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

I love this, but I was just given a change in the data and this no longer works. They added in "Status" (Full/Parttime/Contractor) and "Office" (Accounting, IT, etc). 

PersonnelStatusOfficeTraining1Training2
John DoeFull-timeIT1/1/20241/2/2023
Jane DoeContractorAccounting1/3/20221/4/2024

 

So now if I try this, I will have 2 random fields that I don't want in the slicer.

Hi @EnterThaBoyd 
If you add columns you should select all of them except for training dates before unpivot.

Ritaf1983_0-1723259156110.pngRitaf1983_1-1723259198090.pngRitaf1983_2-1723259213992.png

The updated pbix is attached

If this post helped, please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.