Home > database >  Power BI-Customer purchase count
Power BI-Customer purchase count

Time:10-28

I need to detect the number of customers who make purchases in the 2 stores with a single formula

data: enter image description here Result: 1 Person

CodePudding user response:

Create this below measure-

person_count = 

var total_shop_count = DISTINCTCOUNT(your_table_name[Shop])

var tab = 
SUMMARIZE(
    your_table_name,
    your_table_name[Name],
    "shop_count",DISTINCTCOUNT(your_table_name[Shop])
)

return 
COUNTROWS(
    FILTER(
        tab,
        [shop_count] = total_shop_count
    )
)

Here is the output-

enter image description here

  • Related