Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to figure out how to write an expression to show percentage.
In my data, I have a following dimensions:
Country
State
City
Name
LCode (Values will be something like C1,C2,C3,C4)
I want to show Graph of LCode = C4 as percentage of toatl number of rows for a given Country at first level. For example there 8 entries for India out of which 4 have LCode as C4 and 16 entries for China out of which 4 have LCode as C4 then I should get two bars in the graph. One of India and other for China and it should show C4% as 50%(i.e 4/8) for India and 25%(i.e 4/16) for China
Then similarly show of LCode = C4 as percentage of toatl number of rows for a given States at second level
I have created a Group of Country & State and I am able to show the individual count of C4 using expression Count({<[LCode] = {"C4"}>}[LCode]). However, I am unable to figure out expression to convert it to percentage of total number of rows in a country/state
Please can you help?
Regards
Akbar
try:
Count({<[LCode] = {"C4"}>} [LCode]) / Count(total <Country> [LCode])
Count({<[LCode] = {"C4"}>} [LCode]) / Count(total <Country,State> [LCode])
etc...
try:
Count({<[LCode] = {"C4"}>} [LCode]) / Count(total <Country> [LCode])
Count({<[LCode] = {"C4"}>} [LCode]) / Count(total <Country,State> [LCode])
etc...
Thanks it worked.