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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Amend Measure to Count Rows NOT based on MAX and MAXX

Hi Experts

 

How would you amend the following measure to count the number of row (and ignore Max and maxx) in the current measure..

_m_get_last_result_count_1 = 
// 1st step of 3-sum up counts of last assessed ctrl per org.
//Used in [_m_get_last_result_count_final]
VAR latest_assessed_on =
    CALCULATE (
        MAXX (
            vw_fct_msi_icontrol_task_execution_assessments,
            vw_fct_msi_icontrol_task_execution_assessments[assessed_on]
        ),
        FILTER (
            vw_fct_msi_icontrol_task_execution_assessments,
            NOT ISBLANK ( vw_fct_msi_icontrol_task_execution_assessments[assessed_on] )
                && NOT ISBLANK ( vw_fct_msi_icontrol_task_execution_assessments[result_rating] )
        )
    )
VAR getRows =
    CALCULATE (
        COUNTROWS ( vw_fct_msi_icontrol_task_execution_assessments ),
        FILTER (
            vw_fct_msi_icontrol_task_execution_assessments,
            NOT ISBLANK ( vw_fct_msi_icontrol_task_execution_assessments[assessed_on] )
                && NOT ISBLANK ( vw_fct_msi_icontrol_task_execution_assessments[result_rating] )
        ),
        vw_fct_msi_icontrol_task_execution_assessments[assessed_on] = latest_assessed_on
    )
VAR get_max =
    MAXX ( vw_fct_msi_icontrol_task_execution_assessments, getRows )
RETURN
    get_max
1 ACCEPTED SOLUTION
AmiraBedh
Super User
Super User

I don't understand really the context but here is a try : 

 

_m_get_last_result_count_1 = 
VAR getRows =
    CALCULATE (
        COUNTROWS ( vw_fct_msi_icontrol_task_execution_assessments ),
        FILTER (
            ALL(vw_fct_msi_icontrol_task_execution_assessments), // This will reset any filters on your table
            NOT ISBLANK ( vw_fct_msi_icontrol_task_execution_assessments[assessed_on] )
                && NOT ISBLANK ( vw_fct_msi_icontrol_task_execution_assessments[result_rating] )
        )
    )
RETURN
    getRows

I supposed that you need to eliminate all the filters. If possible share your dataset and tell us what you want to achieve.

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

1 REPLY 1
AmiraBedh
Super User
Super User

I don't understand really the context but here is a try : 

 

_m_get_last_result_count_1 = 
VAR getRows =
    CALCULATE (
        COUNTROWS ( vw_fct_msi_icontrol_task_execution_assessments ),
        FILTER (
            ALL(vw_fct_msi_icontrol_task_execution_assessments), // This will reset any filters on your table
            NOT ISBLANK ( vw_fct_msi_icontrol_task_execution_assessments[assessed_on] )
                && NOT ISBLANK ( vw_fct_msi_icontrol_task_execution_assessments[result_rating] )
        )
    )
RETURN
    getRows

I supposed that you need to eliminate all the filters. If possible share your dataset and tell us what you want to achieve.

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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