0
votes

Follow Up :

I have these two tables that are mutually exclusive (not connected in any way) .

The first table has date , number of customers on the dayDISTINCTCOUNT(sales[user_name]), total sales , tier (text - will explain)

The second table is CustomerLimit which is basically consecutive numbers between 1 and 100.

Used the tier measure as the answer below (thank you)

Tier = VAR Limit = SELECTEDVALUE ( CustomerLimit[CustomerLimit] )

VAR CustCount = COUNT ( Customers[CustomerID] )

RETURN

IF (

ISBLANK ( Limit ), "Select a value",

IF ( CustCount > Limit, "Good", "Bad" )

)

Now I need to aggregate the total amount of customers by Tier. I used calculate(DISTINCTCOUNT(sales[user_name]),Tier = "Good") .

It give me an error of : A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

Is that possible ?

enter image description here

1

1 Answers

0
votes

You can capture the limit using SELECTEDVALUE and then compare.

Tier =
VAR Limit = SELECTEDVALUE ( CustomerLimit[CustomerLimit] )
VAR CustCount = COUNT ( Customers[CustomerID] )
RETURN
    IF (
        ISBLANK ( Limit ), "Select a value",
        IF ( CustCount > Limit, "Good", "Bad" )
    )