Forum Discussion

TonyAshton's avatar
TonyAshton
Frequent Visitor
3 years ago
Solved

DAX help requied

I need help with creating a measure for the percentage of products with more than 1000 sales.   The table I have is called products which is a list of sales with each row a unique sale. Within this...
  • FreemanZ's avatar
    3 years ago

    hi TonyAshton 

    try like:

    BestProduct% =
    VAR _allrproduct = 
    COUNTROWS(ALL(TableName[Product Name]))
    VAR _bestproduct =
    COUNTROWS(
        FILTER(
            VALUES(TableName[Product Name]),
            CALCULATE(COUNTROWS(TableName))>=1000
        )
    )
    RETURN
    DIVIDE(_bestproduct, _allrproduct)