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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
AshishTanwar88
Frequent Visitor

Create two list from same parent table with difference conditon.

Hi,

I have the main table having details of the employees present on a given date. Now I need to create a report with two date slicer (done) and two lists having the employee details as per the below notes:

 

Note: Lora was absent on 1/22/2025 and Martin was absent on 1/24/2025

 

Report requirement:

Result Table 1 should have the Employee present on [Date Filter 1] but not [Date Filter 2]

Martin in the example above

Result Table 2 should have the Employee present on [Date Filter 2] but not [Date Filter 1]

Lora in the example above

 

Please help, Thank you In advance.

 

Screenshot 2025-02-07 at 10.39.10 PM.png

1 ACCEPTED SOLUTION

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1739415848992.png

 


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

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file.


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

Hi @Ashish_Mathur 

 

Here is the sample data. Thank you for looking into this.

 

 

Report Data

 

Em ID

AttendanceDate

Emp name

E01

1/22/2025

Sam

E02

1/22/2025

Martin

E04

1/22/2025

Smith

E01

1/23/2025

Sam

E02

1/23/2025

Martin

E03

1/23/2025

Lora

E04

1/23/2025

Smith

E01

1/24/2025

Sam

E03

1/24/2025

Lora

E04

1/24/2025

Smith

 

 

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1739415848992.png

 


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

Thanks alot @Ashish_Mathur, working perfectly 🙂

You are welcome.


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

Dear @AshishTanwar88 ,

Try below steps:

Load the Data:

Load the source table into Power BI.

 

Create Two Date Slicers:

Add a slicer for AttendanceDate in the Power BI report. Duplicate this slicer to create two independent slicers for Date Filter 1 and Date Filter 2

 

Create Calculated Tables:

Use DAX to create two calculated tables for Result Table 1 and Result Table 2.

DAX for Result Table 1

This table includes employees present on Date Filter 1 but absent on Date Filter 2:

ResultTable1 = 
VAR FilterDate1 = SELECTEDVALUE(SlicerTable1[AttendanceDate])
VAR FilterDate2 = SELECTEDVALUE(SlicerTable2[AttendanceDate])
RETURN
FILTER(
    MainTable,
    MainTable[AttendanceDate] = FilterDate1 &&
    NOT(MainTable[Em ID] IN 
        CALCULATETABLE(
            VALUES(MainTable[Em ID]),
            MainTable[AttendanceDate] = FilterDate2
        )
    )
)

DAX for Result Table 2

This table includes employees present on Date Filter 2 but absent on Date Filter 1:

ResultTable2 = 
VAR FilterDate1 = SELECTEDVALUE(SlicerTable1[AttendanceDate])
VAR FilterDate2 = SELECTEDVALUE(SlicerTable2[AttendanceDate])
RETURN
FILTER(
    MainTable,
    MainTable[AttendanceDate] = FilterDate2 &&
    NOT(MainTable[Em ID] IN 
        CALCULATETABLE(
            VALUES(MainTable[Em ID]),
            MainTable[AttendanceDate] = FilterDate1
        )
    )
)

Add the Tables to the Report:

  • Use a table visual in Power BI to display the data from Result Table 1 and Result Table 2.
  • Customize the Report:

Add titles and labels to clearly indicate what each table represents.

Result

  • Result Table 1: Displays employees present on Date Filter 1 but absent on Date Filter 2 (e.g., Martin)
  • Result Table 2: Displays employees present on Date Filter 2 but absent on Date Filter (e.g., Lora)

 

Please mark this as solution if it helps you. Appreciate Kudos.

Thanks for your response on this, I am following your solution but some how it is not working at my end, below is my DAXs to create the tables:

 

ResultTable1 =
VAR FilterDate1 = SELECTEDVALUE(Messages[MessageDateOnly])
VAR FilterDate2 = SELECTEDVALUE(Messages[MessageDateOnly])
RETURN
FILTER(
Messages,
Messages[MessageDateOnly] = FilterDate1 &&
NOT(Messages[DealerNumberID] IN
CALCULATETABLE(
VALUES(Messages[DealerNumberID]),
Messages[MessageDateOnly] = FilterDate2
)
)
)

 

 

ResultTable2 =
VAR FilterDate1 = SELECTEDVALUE(Messages[MessageDateOnly])
VAR FilterDate2 = SELECTEDVALUE(Messages[MessageDateOnly])
RETURN
FILTER(
Messages,
Messages[MessageDateOnly] = FilterDate2 &&
NOT(Messages[DealerNumberID] IN
CALCULATETABLE(
VALUES(Messages[DealerNumberID]),
Messages[MessageDateOnly] = FilterDate1
)
)
)

 

Any views on this?

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors