Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Using a created measure as a filter

Hi,

I have created a measure as follows:

carcount =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            house,
            [house_id],
            "count", DISTINCTCOUNT ( [number_of_cars] )
        ),
        [count] > 1
    )
)

I want to use this as a filter for a KPI i have which counts the total number of "house_id". 

E.g. If total number of "house_id" = 100, I want to use the above measure as a filter to give me a count of "house_id" where the condition of the filter is met.

I cant use the measure I created as a "on visual" filter for some reason, how can i achieve this?

2 Replies

  • Anonymous , something like this

     


    carcount =
    var _1 = calculate(DISTINCTCOUNT ( [house_id] ), allselected())
    return
    if(_1 >100 ,
    COUNTROWS (
    FILTER (
    SUMMARIZE (
    house,
    [house_id],
    "count", DISTINCTCOUNT ( [number_of_cars] )
    ),
    [count] > 1
    )
    ), blank())

  • Hi, Anonymous 

     

    The slicer cannot use the measure value as a field to filter. You can try to use the visual level filter pane on the right to add the measure value to filter, or create a calculated column to use the slicer to filter.

    Hope this helps.

     

    Best Regards,
    Community Support Team _ Zeon Zheng
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.