Forum Discussion
Fahim78666
1 year agoRegular Visitor
Power bi
I need to know how to calculate the sales category on general customers For example how many sales completed from the range of $1 to 50 and $50 to $100 Please help me to do this using power bi ...
Anonymous
1 year agoNot applicable
Hi Fahim78666
Based on your needs, I have created the following table.
First of all, you need to categorize the sales of different customers
category = IF(SELECTEDVALUE('Table'[sales])>=1 && SELECTEDVALUE('Table'[sales])<50,
"$1 to 50" ,
IF(SELECTEDVALUE('Table'[sales])>=50 && SELECTEDVALUE('Table'[sales])<=100,
"$50 to $100",
BLANK()))
Then count the different sales categories.
count =
VAR _category = [category]
VAR _count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[category]=_category))
RETURN _count
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.