Forum Discussion

Ilse_ScpDt's avatar
Ilse_ScpDt
Icon for Helper I rankHelper I
4 years ago
Solved

Count of count

Hi,   I have a table with vacanies and applicants.   Vac Appl 1     A 1     B 1     C 2     D 3     E 3     F 4     G   I counted the number of Applicants per Vacany wth following formul...
  • Jihwan_Kim's avatar
    Jihwan_Kim
    4 years ago

    Hi,

    Please check the below picture and the attached pbix file.

    It is for creating measures.

     

     

    Count measure: =
    VAR currentVAC =
    MAX ( Data[Vac] )
    VAR newtable =
    FILTER ( ALL ( Data ), Data[Vac] = currentVAC )
    RETURN
    IF ( HASONEVALUE ( Data[Vac] ), COUNTROWS ( newtable ) )
     
    Count2 measure: =
    VAR currentCount = [Count measure:]
    VAR newtable =
    FILTER (
    SUMMARIZE ( ALL ( data ), Data[Vac], Data[Count CC] ),
    Data[Count CC] = currentCount
    )
    RETURN
    COUNTROWS ( newtable )
  • Jihwan_Kim's avatar
    Jihwan_Kim
    4 years ago

    Hi,

    If you want to add slicer, please try to use ALLSELECTED function, instead of using ALL function.

    Please check the attached file.