Forum Discussion

sivarajan21's avatar
sivarajan21
Icon for Post Prodigy rankPost Prodigy
2 years ago

Count Dax needs a tweak to return a correct count for corresponding dates selected

Hi,

 

I am trying to find the count of DBName_id for the below conditions(selected date,filter conditions) as shown in below screenshot:

 

Below is the dax measure i tried for it:

Count =
CALCULATE (
DISTINCTCOUNT ( 'cumulus_licensee estatemanagement_contacts'[DBName_id] ),
FILTER (
'cumulus_licensee estatemanagement_contacts',
'cumulus_licensee estatemanagement_contacts'[Measure 2] > 0
)
)

 

I have not referenced the 'Database Name measure' in above measure and doubt that is causing issues, but i am not sure how to include that in above measure. 

Database Name = MAX ( 'cumulus_licensee estatemanagement_contacts'[Name] )
 

My expected output is count of 1 as shown below:

The count measure count would be dynamic, means when date is selected it will change accordingly.

 

Please help me to resolve this issue

PFA file here Timetravel.pbix

 

Thanks in advance!

amitchandak Ahmedx marcorusso Anonymous jdbuchanan71 Greg_Deckler 

4 Replies

  • Your data model is missing a data model. Please fix that first.

     

     

    • sivarajan21's avatar
      sivarajan21
      Icon for Post Prodigy rankPost Prodigy

      Hi lbendlin ,

       

      Thanks for your response!

      Could you please elaborate on what is missing and what can be done to resolve the issue?

       

      Thanks in advance!

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        identify your dimensions and facts. link 1:* from dimension to fact, single direction.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi sivarajan21 ,

    Please try:

    Count =
    COUNTX (
        FILTER (
            SUMMARIZE (
                'cumulus_licensee estatemanagement_contacts',
                'cumulus_licensee estatemanagement_contacts'[DBName_id],
                "@Measure 2", [Measure 2]
            ),
            [@Measure 2] > 0
        ),
        'cumulus_licensee estatemanagement_contacts'[DBName_id]
    )

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group