Forum Discussion
%age require a text coulmn
- 3 years ago
Cout = COUNTROWS('Table')
Count All = COUNTROWS('ALL('Table')
Count Per = DIVIDE([Count],[Count All]) - 3 years ago
Hi naseem_1973 ,
Hope this works for you.
Measure = COUNT(CTable[Category])/CALCULATE(COUNT(CTable[Category]),ALL(CTable[Category])) - 3 years ago
Okey, I have just realized why!!!
You are using a var as the name of the function. Var is used to store values (https://learn.microsoft.com/en-us/dax/var-dax). Take a look at my code, the name is % of communications. I will paste it again:
% of communications = var allValues= CALCULATE([Total communications],ALLSELECTED(MyTable[Communication Method])) return DIVIDE([Total communications],allValues,0)
BTW, variables are really useful in Power BI to improve readability and performance sometimes (https://learn.microsoft.com/en-us/dax/best-practices/dax-variables).
Please check where I doing mistake.
Okey, I have just realized why!!!
You are using a var as the name of the function. Var is used to store values (https://learn.microsoft.com/en-us/dax/var-dax). Take a look at my code, the name is % of communications. I will paste it again:
% of communications =
var allValues= CALCULATE([Total communications],ALLSELECTED(MyTable[Communication Method]))
return DIVIDE([Total communications],allValues,0)
BTW, variables are really useful in Power BI to improve readability and performance sometimes (https://learn.microsoft.com/en-us/dax/best-practices/dax-variables).
- naseem_19733 years agoHelper I
Thanks,
its working