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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Calculated Table from based on values from another table

Hello,

 

I have a table with Staff Name and Status Number as follows:

 

DateStaff NameStatus Number
01/11/2022A1
01/11/2022A2
01/11/2022A3
01/11/2022A4
01/11/2022B1
01/11/2022B2
01/11/2022B3
01/11/2022B4
01/11/2022C1
01/11/2022C3
01/11/2022C4
01/11/2022D1
01/11/2022D2
01/11/2022D3
01/11/2022D4
01/11/2022E1
01/11/2022E3
01/11/2022E4

 

I need a calculated table from this such that it if a STAFF NAME has STATUS NUMBER = 2, the rows corresponding to that particular staff name should be ignored. In this case, the output for the above table should be:

 

DateStaff Name
01/11/2022C
01/11/2022E

 

I tried creating a calc table from the main table filtered with STATUS = 2 and then tried an anti join using EXCEPT function but it does not work.

 

Any help is deeply appreciated. Thanks in advance!

 

Midhun

 

@amitchandak @Greg_Deckler 

1 ACCEPTED SOLUTION

Then you can try something like this:

Calculated table =
VAR __Filter =
    CALCULATETABLE( VALUES( Staff[StaffName] ), Staff[StaffNumber] = 2 )
VAR __Result =
    FILTER (
        SUMMARIZECOLUMNS ( Staff[Date], Staff[StaffName] ),
        NOT ( Staff[StaffName] ) IN __Filter
    )
RETURN __Result
 
Br
Marius

Br
Marius
BI Fabrikken
www.bifabrikken.no

View solution in original post

9 REPLIES 9
mariussve1
Super User
Super User

Hi,

 

Could you try to create a calculated table with the following DAX query:

 

New calculated table =
CALCULATETABLE (

SUMMARIZECOLUMNS ( Table[Date], Table[Staff name], Table[Staff number] ),

NOT ( Table[Staff number] ) = 2

)

 

Br

Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no
Anonymous
Not applicable

Hi,

 

This does not work as the output will have all entries with STATUS NUMBER not equal to 2:

 

DateStaff NameStatus Number
01/11/2022A1
01/11/2022A3
01/11/2022A4
01/11/2022B1
01/11/2022B3
01/11/2022B4
01/11/2022C1
01/11/2022C3
01/11/2022C4
01/11/2022D1
01/11/2022D3
01/11/2022D4
01/11/2022E1
01/11/2022E3
01/11/2022E4

 

Thanks!

Hi again 🙂

 

Ok, so what you want is that all staff name that equal to the same name as staff number 2 should be filtered away?

 

Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no

Then you can try something like this:

Calculated table =
VAR __Filter =
    CALCULATETABLE( VALUES( Staff[StaffName] ), Staff[StaffNumber] = 2 )
VAR __Result =
    FILTER (
        SUMMARIZECOLUMNS ( Staff[Date], Staff[StaffName] ),
        NOT ( Staff[StaffName] ) IN __Filter
    )
RETURN __Result
 
Br
Marius

Br
Marius
BI Fabrikken
www.bifabrikken.no
Anonymous
Not applicable

Hi Marius,

 

I get an empty table returned when i use the above.

 

Thanks!

Midhun

Hi again.

I have created a test .pbix file where this is working as expected, but I cant upload it on this website. Would you like me to send it on email?

Br

Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no
Anonymous
Not applicable

Hello Marius. That would be great!

Can you please send it to midmurali57@gmail.com?

I have now sendt you an email with the example .pbix file that works as expected 🙂
Please let me know how it goes.

Br

Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no
Anonymous
Not applicable

Hi Marius,

 

If there is a STATUS NUMBER = 2 corresponding to any name, I want my final table to not include that particular name.

 

I hope you understood now.

 

Thanks

Midhun

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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