Forum Discussion

Dunner2020's avatar
Dunner2020
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Count measure does not display all values

Hi there,

 

I have two tables: date and Authorisation. The authorization table contains the information about the individual and its practice certificate start and expiry date. I have created a measure that counts the valid authorization ids. Valid authorization means those authorizations whose expiry date is in the current financial year or upcoming ones (not in previous financial years) and start date of the authorization should not be starting in upcoming financial years.  I want to display the measure in a line graph where the x-axis contains the financial years. My measure is as follow:

Count Authorisation FY = CALCULATE(COUNT('ECR Authorisation'[AuthorisationID]),FILTER(dates,Dates[FiscalYearOffset] <=0))
 
When I displayed the above measure, it looks like as follow:
 

The problem with above measure is that it does not display the total of authorization ids which are valid each financial year. It only shows the count of authorisation that will be expired in that particular year. could anyone help me where I made the mistake?

 

Sample file here

 
 

 

 

  • Hi Dunner2020 ,

     

    Modify your measure as below:

    Count Authorisation FY =
    CALCULATE (
        DISTINCTCOUNT ( 'ECR Authorisation'[AuthorisationID] ),
        FILTER (
            ALLSELECTED ( dates ),
            Dates[FiscalYearOffset] <= 0
                && 'Dates'[Fiscal Year] = MAX ( 'Dates'[Fiscal Year] )
        )
    )
    

    And you will see:

     

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my reply as a solution!

2 Replies

  • TheoC's avatar
    TheoC
    Icon for Community Champion rankCommunity Champion

    Hi Dunner2020 

     

    Can you try the following:

     

    Count Authorisation FY = 

    VAR _CountTotal = COUNTROWS ( 'ECR Authorisation')

    RETURN

    CALCULATE( _CountTotal , FILTER ( Dates, Dates[FiscalYearOffset] <=0 ) )
  • v-kelly-msft's avatar
    v-kelly-msft
    Icon for Community Support rankCommunity Support

    Hi Dunner2020 ,

     

    Modify your measure as below:

    Count Authorisation FY =
    CALCULATE (
        DISTINCTCOUNT ( 'ECR Authorisation'[AuthorisationID] ),
        FILTER (
            ALLSELECTED ( dates ),
            Dates[FiscalYearOffset] <= 0
                && 'Dates'[Fiscal Year] = MAX ( 'Dates'[Fiscal Year] )
        )
    )
    

    And you will see:

     

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my reply as a solution!