Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Snurresprett
New Member

Different dates and categorical values in same rows

Hi,

 

I'm currently trying to solve an issue that I've got stuck at. I'm having data from a Sharepoint List where each row is a candidate applying for a job, and most of the candidates has to go through three different interviews. Each row as plenty of other attributes as well, but this is were I got stuck.

 

The data looks like:

 

Candidate

Name

Interview 1#  DateInterview 1#  NameInterview 2#  DateInterview 2#  NameInterview 3#  DateInterview 3#  Name
Candidate #12024-01-01Adam2024-02-01Anna2024-03-01Anna
Candidate #22024-01-05Anthony2024-02-05Anthony2024-03-05Adam
Candidate #32024-01-11Anna2024-02-11Adam2024-03-11Anthony

 

And I would like to build a matrix sums the interviews per interviewer, per month that they were actually held, like this:

 

No. of interviewsJanuary 24'February 24'...
Adam23...
Anthony11......
Anna33....

 

I've searched the web for several hours, and trying to seperating them into different tables and and relate date 1#, 2# and 3# to a separate date table and sum the values to it, but I'm really stuck on what kind of direction I should go to try and solve it.

 

As you might have realized, I'm realtively new to PBI but also very interested in learning, so all comments and tips are more than welcome!

 

 

 

2 ACCEPTED SOLUTIONS
vicky_
Super User
Super User

Ideally, you'd be able to get your data in a format similar to below: 

Candidate Interview Date Interview Name
Candidate #1 1/01/2024 Adam
Candidate #2 5/01/2024 Anthony
Candidate #3 11/01/2024 Anna
Candidate #1 1/02/2024 Anna
Candidate #2 5/02/2024 Anthony
Candidate #3 11/02/2024 Adam
Candidate #1 1/03/2024 Anna
Candidate #2 5/03/2024 Adam
Candidate #3 11/03/2024 Anthony

From which you can easily get your desired table since there's only one date column. 

 

If you can't do that, then you can do so with dax - create the 1:M relationships between your date table and each of the dates (but leave 2 of them inactive; note the dotted lines):

vicky__0-1722897380647.png

Then create a measure like the following:

No Interviews = COUNTROWS('Table') + CALCULATE(COUNTROWS('Table'), USERELATIONSHIP('date table'[Date], 'Table'[Interview 2#  Date])) + CALCULATE(COUNTROWS('Table'), USERELATIONSHIP('date table'[Date], 'Table'[Interview 3#  Date]))

The first COUNTROWS('Table') will use date 1 (since it's the one that's active in my table), the 2nd will use date 2 and the 3rd will use date 3. You can use a similar method to get the Interviewer names on the rows (i.e create a table with all of the unique names of the interviewers and then use calculate parameters to force your table to use the inactive relationships).

View solution in original post

DataNinja777
Super User
Super User

Hi @Snurresprett ,

 

You can typically use Power Query's Unpivot function to achieve the unpivoted data that @vicky_ mentions.

DataNinja777_3-1722906693614.png

 

After using the Unpivot Other Columns function in Power Query, you can use DAX to consolidate the names of the interviewers into one column instead of three columns.

DataNinja777_0-1722906198505.png

Then, you can create a relationship between your unpivoted fact table and the calendar table.

DataNinja777_1-1722906280612.png

The resultant output from your sample data of three lines is shown below:

DataNinja777_2-1722906562301.png

 

I have attached a sample PBIX file.

View solution in original post

3 REPLIES 3
Snurresprett
New Member

@DataNinja777 @vicky_ Wow, thank you very much for detailed explainations! I was able to elaborate your solutions to fit the other attributes in the dataset as well! New insights and much joy came out of this! I wish you both all the best!

DataNinja777
Super User
Super User

Hi @Snurresprett ,

 

You can typically use Power Query's Unpivot function to achieve the unpivoted data that @vicky_ mentions.

DataNinja777_3-1722906693614.png

 

After using the Unpivot Other Columns function in Power Query, you can use DAX to consolidate the names of the interviewers into one column instead of three columns.

DataNinja777_0-1722906198505.png

Then, you can create a relationship between your unpivoted fact table and the calendar table.

DataNinja777_1-1722906280612.png

The resultant output from your sample data of three lines is shown below:

DataNinja777_2-1722906562301.png

 

I have attached a sample PBIX file.

vicky_
Super User
Super User

Ideally, you'd be able to get your data in a format similar to below: 

Candidate Interview Date Interview Name
Candidate #1 1/01/2024 Adam
Candidate #2 5/01/2024 Anthony
Candidate #3 11/01/2024 Anna
Candidate #1 1/02/2024 Anna
Candidate #2 5/02/2024 Anthony
Candidate #3 11/02/2024 Adam
Candidate #1 1/03/2024 Anna
Candidate #2 5/03/2024 Adam
Candidate #3 11/03/2024 Anthony

From which you can easily get your desired table since there's only one date column. 

 

If you can't do that, then you can do so with dax - create the 1:M relationships between your date table and each of the dates (but leave 2 of them inactive; note the dotted lines):

vicky__0-1722897380647.png

Then create a measure like the following:

No Interviews = COUNTROWS('Table') + CALCULATE(COUNTROWS('Table'), USERELATIONSHIP('date table'[Date], 'Table'[Interview 2#  Date])) + CALCULATE(COUNTROWS('Table'), USERELATIONSHIP('date table'[Date], 'Table'[Interview 3#  Date]))

The first COUNTROWS('Table') will use date 1 (since it's the one that's active in my table), the 2nd will use date 2 and the 3rd will use date 3. You can use a similar method to get the Interviewer names on the rows (i.e create a table with all of the unique names of the interviewers and then use calculate parameters to force your table to use the inactive relationships).

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors