Forum Discussion

Sondre's avatar
Sondre
Frequent Visitor
2 years ago

Only used data with item count over given number

Hi,

 

I have a page for scrap tracking showing:

  • A matrix for Employee (Emp), with count, scrap and scrap%.
  • A matrix with corresponding Gridsheet scrap location (B02 - T30).

I want to sort it so to only use data with Emp count higher than 300. This is OK with filtering in the matrix for Emp, but I want it to also apply for the Gridsheet table so than only data for Emp count over 300 is taken into account.

I also have a slicer for date on the page. The >300 should be working within the slicer.

 

I've tried adding this for the Gridsheet matrix, but it only gives me a number with blank gridsheet location.

 

Measure = CALCULATE(COUNT(Query[Gridsheet_location]), FILTER(Query, COUNT(Query[Emp]) >= 300))

 

 

Any suggestions?

2 Replies

  • Measure = //Try this 
    CALCULATE(
        COUNTROWS('Gridsheet'),
        FILTER(
            VALUES('Gridsheet'[Emp]),
            CALCULATE(
                COUNTROWS('Query'),
                FILTER('Query', 'Query'[Emp] = 'Gridsheet'[Emp])
            ) >= 300
        )
    )
    • Sondre's avatar
      Sondre
      Frequent Visitor

      Thanks for the reply!

      I have all data for this in one query. Tried the following. Total is correct, but no gridsheet location is shown.

      Measure = 
      CALCULATE(
          COUNT(Query[Gridsheet_location]),
          FILTER(
              VALUES(Query[Emp]),
              CALCULATE(COUNTROWS(Query)) >= 300
          )
      )