Forum Discussion
Error message with the calculate function
Hi Touaibia
It'd be better if you shared the sample of your data, right now it's not that clear.
Try this:
Measure =
Var _A = filter(Addcolumns(Values(Sales_Table[IdProduct]),"No.24P",calculate(Countrows(Product_table),filter(Product_table,Product_table[Product_table]="Yes"))),[No.24P]=24)
return
COUNTX(_A,[No.24P])
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Ok so I have this data model
Client table with : IdCustomer / SalesRep / Area / CustomerProfil
ProductTable : IdProduct / ProductName / 24StrategicProduct
SalesTable : IdCustomer /IdProduct / Sales
1 - I want to calculate for each customer the number of strategic product he had pruchased.
i did this : calculate ( distinctcount(SalesTable [IdProduct]), ProductTable[24StrategicProduct]="Yes")
And it Works, when I set up a table with all my customers i do have the count of my stratgic products each clients had purchased.
2- Now I want to set up a table with my CustomerProfil ( wich contains only 3 values A B C ) and add a measure that return the number of customers who have purchased at least one time all my 24 strategic products.
and i'm stuck in this formula 😞
Tnx