Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Count rows in a Power BI table visual

 

Hi experts,

I have a Power BI table visual that displays rows of data from Dim_Product and Fact_Results only. However, my end users want to see the total number, and I have used the following DAX measure to count it, but it is incorrect.

For instance, the table visual shows 24 rows, but the DAX measure shows 152.

 

Rows_Count =
COUNTROWS(
    SUMMARIZE(
        Fact_Result,
        Dim_Product[Product],
        Fact_Result[Date_Reviewed_Result_dd-mm-yyyyy],
        Fact_Result[Test Name],
        Dim_Product[T_COMPOSITE_GROUP],
        Fact_Result[Spec Limits],
        Dim_Unit[DISPLAY_STRING],
        Dim_Product[PROCESS_UNIT]
    )
)
 
I have tried another measure but still incorrect
Rows_Count =
CALCULATE(
        COUNTROWS(Fact_Result),
        NOT(ISBLANK(Dim_Product[Product])),
        NOT(ISBLANK(Fact_Result[Date_Reviewed_Result_dd-mm-yyyyy])),
        NOT(ISBLANK(Fact_Result[Test Name])),
        NOT(ISBLANK(Dim_Product[T_COMPOSITE_GROUP])),
        NOT(ISBLANK(Fact_Result[Spec Limits])),
        NOT(ISBLANK(Dim_Unit[DISPLAY_STRING])),
        NOT(ISBLANK(Dim_Product[PROCESS_UNIT]))
        )

Please help
Thanks
 


1 Reply

  • Hey Anonymous ,

     

    please consider creating a pbix that contains sample data but still reflects your data model: tables, relationships, calculated columns, and measures. Upload the bpix to onedrive, googledrive, or dropbox and share the link. If you import the sample data from an Excel file, share the Excel file as well.

     

    Do not forget to describe the expected outcome based on the sample data.

     

    Regards,

    Tom