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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Exclude values using DAX

Can you please advise how to solve the following issue: We have several Research activities that are part of the same 'Opdracht', so they have the same OPDRACHTID. Some activities are already invoiced and the ones that are invoiced have been marked with a factuurID. Now I want to make a report of the OPDRACHTID's containing Research activities that have never been invoiced. So when an OPDRACHTID contains only one activity that has been invoiced, I want to exclude the whole OPDRACHTID from the list. 

 

See below example:

 

OPDRACHTIDfactuurIDResearch activities
2018-0004-001 Authorize report
2018-0004-001 Authorize task
2018-0004-001 Report process control
2018-0004-00143246Periodic control
2018-0004-00143246Test article
2018-0004-002 Authorize report
2018-0004-002 Authorize task
2018-0004-002 Report process control
2018-0004-00243246Periodic control
2018-0004-003 Autorize report
2018-0004-003 Report process control
2018-0004-004 Authorize report
2018-0004-004 Authorize task
2018-0004-004 Report process control
2018-0004-00443846Periodic control
2018-0004-005 Authorize report
2018-0004-005 Authorize task
2018-0004-005 Report process control
2018-0004-005 Report process control
2018-0004-006 Authorize report
2018-0004-006 Authorize task
2018-0004-006 Report process control
2018-0004-00644902Periodic control
2018-0004-00644902Control article

 

So from the above example I want to maintain the bold marked OPDRACHTID's in my report. All other OPDRACHTID's have at least one Research activity that has been invoiced (factuurID). Any advise on how I can achieve this would be much appreciated!

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Try this calculated table

From Modelling tab>>>NEw Table

 

Calculated Table =
VAR IDs_with_factur =
    CALCULATETABLE (
        VALUES ( Table1[OPDRACHTID] ),
        FILTER ( Table1, Table1[factuurID] <> BLANK () )
    )
VAR IDs_without_factur =
    EXCEPT ( VALUES ( Table1[OPDRACHTID] ), IDs_with_factur )
RETURN
    FILTER ( Table1, Table1[OPDRACHTID] IN IDs_without_factur )

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Try this calculated table

From Modelling tab>>>NEw Table

 

Calculated Table =
VAR IDs_with_factur =
    CALCULATETABLE (
        VALUES ( Table1[OPDRACHTID] ),
        FILTER ( Table1, Table1[factuurID] <> BLANK () )
    )
VAR IDs_without_factur =
    EXCEPT ( VALUES ( Table1[OPDRACHTID] ), IDs_with_factur )
RETURN
    FILTER ( Table1, Table1[OPDRACHTID] IN IDs_without_factur )
Anonymous
Not applicable

Thanks very much @Zubair_Muhammad!! This solved my problem.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors