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

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.

Reply
Darko_Giac
Helper II
Helper II

Creating Conditional Columns Filtered Within Rows

Hi all,

 

I'm currently working with a fairly large data set (for which I included a sample), and am having some issues developing a flags that will filter within rows.

 

For example, I'm currently analyzing test data that requires students take a test at one time, then come back to take the test again at another, later date. So Student 101 would have two entries across a few variables:

 

 

However, there a couple of conditions I'm trying to build in:

 

1). The re-test can't have happened two weeks BEFORE the initial test, or four weeks AFTER.

 

2). I'm also looking to flag discrepencies within IDs and TestStart and EndTimes (for example, both test start and test end should occur on the same day, as the test duration is only a few hours).

 

So ID101 would have a "Invalid Case" flag, as more than four weeks have elapsed between test and retest

 

I have a feeling this is something that could be more effectively done in power pivot, but just not quite sure how to get there.

 

(The data in the attached workbook is also connected to powerpivot)

 

 

Test Retest Workbook

 

Currently using Office 365 ProPlus.

 

Any help is greatly appreciated, thanks in advance!

 

Darko

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my solution workbook from here.

 

Hope this helps.

 

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my solution workbook from here.

 

Hope this helps.

 

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for the solution @Ashish_Mathur!

 

The time/date flag worked really well.

 

I'm wondering whether there is a way to create a gender flag (either through a measure or calculate column) that will flag mismatches in gender between the same ID. 

 

For example,

 

My data are set up so that each ID has two entries, and ID101 for instance might have a gender of Male on one row, but Female on the next row. 

 

Would there be a way to flag those discrepancies?

 

See attached a workbook: Workbook_11.24.2018

 

Thanks again for the help!

 

Darko

Hi,

 

You are welcome.  I receive a message saying "Download not available"


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.