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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jasperdavid
Frequent Visitor

check latest status

Hey guys,

 

I have a table with the results of certain inspections of different parts.

If the inspection was NG ::> status = X

If the inspection was Ok or concession, status = O or C

 

I would like to have a measure that calculates how many parts are still open (so X was given, but not yet O)

 

Part 1  X  01/01/2020

Part 2 X  02/01/2020

Part 1  X  03/ 01/2020

Part 3  X  03/01/2020

Part 2 O 05/01/2020

Part 4 O 06/01/2020

 

So for the example above: the measure should show 2 parts (as part 1 & part 3 have not received O yet), and part 2 has received O so should be excluded from the data.

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @jasperdavid

 

You need a measure as below:

 

Measure =
VAR a =
    CALCULATE (
        COUNT ( 'Table'[status] ),
        ALLEXCEPT ( 'Table', 'Table'[Part] ),
        'Table'[status] <> "O"
    )
VAR b =
    CALCULATE ( COUNT ( 'Table'[status] ), ALLEXCEPT ( 'Table', 'Table'[Part] ) )
RETURN
    IF ( a = b, a, BLANK () )

 

Finally ,you will see:

 

Annotation 2020-02-17 112602.png

 

For the related .pbix file,pls click here.

 


 
Best Regards,
Kelly
 
Did I answer your question? Mark my post as a solution!

 

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi @jasperdavid

 

You need a measure as below:

 

Measure =
VAR a =
    CALCULATE (
        COUNT ( 'Table'[status] ),
        ALLEXCEPT ( 'Table', 'Table'[Part] ),
        'Table'[status] <> "O"
    )
VAR b =
    CALCULATE ( COUNT ( 'Table'[status] ), ALLEXCEPT ( 'Table', 'Table'[Part] ) )
RETURN
    IF ( a = b, a, BLANK () )

 

Finally ,you will see:

 

Annotation 2020-02-17 112602.png

 

For the related .pbix file,pls click here.

 


 
Best Regards,
Kelly
 
Did I answer your question? Mark my post as a solution!

 

amitchandak
Super User
Super User

try to have a measure like this

calculate(countrows(table),allexcept(table,table[part]),table[status]="O"), and use this to filter

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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