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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Count of Measure

Hi, 

Measure Applications counts the number of applications, ProgPerSchool measures distinct program in a school, AppPerSchool measures applications for a school, and AppAverageSchool calculate an average number of applications for a school.

 

 - Want to create a measure that counts the number of programs that receive applications below and above AppAverageSchool.

- Want to create a list and graph of such program

-  link of pbix file Count of Measure Issue

 

Count of Measure.PNG

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try to add the following two measures:

 

Aplications Below = 
COUNTX (
    FILTER (
        SUMMARIZE (
            ALL ( 'Dim Programs'[Program Name] );
            'Dim Programs'[Program Name];
            "ApplicationCount"; [Applications]
        );
        [ApplicationCount] < [AppAverageSchool]
    );
    [ApplicationCount]
)

Aplications Above= 
COUNTX (
    FILTER (
        SUMMARIZE (
            ALL ( 'Dim Programs'[Program Name] );
            'Dim Programs'[Program Name];
            "ApplicationCount"; [Applications]
        );
        [ApplicationCount] > [AppAverageSchool]
    );
    [ApplicationCount]
)

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

5 REPLIES 5
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try to add the following two measures:

 

Aplications Below = 
COUNTX (
    FILTER (
        SUMMARIZE (
            ALL ( 'Dim Programs'[Program Name] );
            'Dim Programs'[Program Name];
            "ApplicationCount"; [Applications]
        );
        [ApplicationCount] < [AppAverageSchool]
    );
    [ApplicationCount]
)

Aplications Above= 
COUNTX (
    FILTER (
        SUMMARIZE (
            ALL ( 'Dim Programs'[Program Name] );
            'Dim Programs'[Program Name];
            "ApplicationCount"; [Applications]
        );
        [ApplicationCount] > [AppAverageSchool]
    );
    [ApplicationCount]
)

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi @MFelix , Thanks for the help.

 

Can you please guide me on how to eliminate programs that have zero applications from the distinct count and measure.

 

Average of Measure.PNG

Hi @Anonymous ,

 

You need to add another parameter on your filter try the following:

 

Aplications Above= 
COUNTX (
    FILTER (
        SUMMARIZE (
            ALL ( 'Dim Programs'[Program Name] );
            'Dim Programs'[Program Name];
            "ApplicationCount"; [Applications]
        );
        [ApplicationCount] > [AppAverageSchool]  || [ApplicationCount] <> BLANK()
    );
    [ApplicationCount]
)

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi @MFelix ,

 

The measures work fine when I select a school and / or college for the count of programs but it breaks when I add a Date field to the context. Your guidance is highly appreciated.

 

Applications =   CALCULATE ( DISTINCTCOUNT(Transactions[Transaction ID]) )

ProgPerSchool =    CALCULATE (  
DISTINCTCOUNT ( 'Dim Programs'[Program Code] ),
ALLEXCEPT('Dim Programs', Dim Programs'[School Name]),'Dim Programs'[Transaction_Count]>0 ) AppPerSchool = CALCULATE ( [Applications], ALLEXCEPT ('Dim Programs','Dim Programs'[School Name])) AppAverageSchl = DIVIDE([AppPerSchool],[ProgPerSchool],99999)

Aplications Above= 
COUNTX (
    FILTER (
        SUMMARIZE (
            ALL ( 'Dim Programs'[Program Name] );
            'Dim Programs'[Program Name];
            "ApplicationCount"; [Applications]
        );
        [ApplicationCount] > [AppAverageSchool] )
    );
    [ApplicationCount])

program image1.PNG

Anonymous
Not applicable

Hi @MFelix , one thing I forgot to mention is that I added tables for the count of the program above and below to the data model just for verification purpose and then a Date field to the context.  

 

The measure also breaks when I use the Date field in the slicer and even when I remove the new tables from the data model.

New Table = FILTER (
        SUMMARIZE (
            ALL ( 'Dim Programs'[Program Name] );
            'Dim Programs'[Program Name];
            "ApplicationCount"; [Applications]
        );
        [ApplicationCount] > [AppAverageSchool] )
    );
    [ApplicationCount])

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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