0
votes

I have a table with repeating values ​​in the index column, and a third column that has values ​​only in some rows

Table I have now:

Table I have now

My objective is to create a new table that selects the CompanyID, Start Date, and Contact Date columns but excludes the rows that have blank values from any of those

New table I want to have:

New table I want to have

I used the following DAX code:

CALCULATETABLE (
    Table,
    FILTER ( Table, NOT ( ISBLANK ( Table[Start Date] ) ) )
)

The issue with this code is that it selects all 350+ columns of my original data instead of just having the 3 columns I want. Additionally, I couldn't figure out how to add additional filters so I don't have blank rows for Contact Date and ComapanyID

I did try the below code as well, but it doesn't work

CALCULATETABLE (
    Table,
    FILTER ( Table, NOT ( ISBLANK ( Table[Start Date] ) ) ),
    FILTER ( Table, NOT ( ISBLANK ( Table[Order Date] ) ) ),
    FILTER ( Table, NOT ( ISBLANK ( Table[Employee Count] ) ) )
)
1

1 Answers

0
votes

The SELECTCOLUMNS function allows you to pick specific columns.

For example:

New Filtered Table =
EVALUATE
SELECTCOLUMNS (
    CALCULATETABLE (
        Table,
        NOT ( ISBLANK ( Table[Start Date] ) ),
        NOT ( ISBLANK ( Table[Order Date] ) ),
        NOT ( ISBLANK ( Table[Employee Count] ) )
    ),
    "CompanyID", Table[CompanyID],
    "Contact Date", Table[Contact Date],
    "Start Date", Table[Start Date]
)