Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi
I'm creating visuals in Power Bi desktop but I'm having trouble with an issue.
İ need to compare individual data with a region data. Here is two separate tables I have
Here I need to select any data (can be selected via slicer or page filtering) from columns (e.g. SEO score for domain3.com) and I want to show it in the bar gragh. Result will be 79.
And next to the bar grah I want to show SEO region average data with a bar graph for domain3.com. Result could be like this:
(domain1.com+domain2.com+domain3.com+domain5.com+domain6.com)/5=(83+90+79+76+91)/5=83.8. We need to select Europe region it is because domain3.com is related Europe region.
I need to create DAX (custom measure for this) but not sure which functions need to be used. Please see the result below in the screenshot.
Any help is much appreciated.
Elshad
Solved! Go to Solution.
[Avg SEO] = AVERAGE( T[SEO] )
[Region Average] =
CALCULATE(
[Avg SEO],
REMOVEFILTERS( T[Domain] ),
KEEPFILTERS( VALUES( T[Region Name] ) )
)
Hi @daxer-almighty Your code really helped me to solve the issue. Thank you so much.
Now I have a a some string values which I need to calculate average with regions but this measure only works with integers. For eaxmle i have a value like this below:
Domain1.com -> insecure CMS
Domain4.com -> insecure CMS
Domain8.com -> insecure CMS
I need to show it as a percentage based on Region like 67% domain use insecure CMS
Do you have any idea how to fix it with DAX?
Thanks!
This measure works now:
Thanks @daxer-almighty for your reply. Current mease does not work. "The syntax for '[Region Average]' is incorrect". Also Power Bi can not find "[AVG SEO]"
Can you please give me a bit clear measure? Thank you!
Hi @Elshad
I'd kindly suggest that you carefully look at what I've written and understand it. Because clearly you don't. Then, when you have understood, do it right in PBI and everything will be working fine as it does on my end.
[Avg SEO] = AVERAGE( T[SEO] )
[Region Average] =
CALCULATE(
[Avg SEO],
REMOVEFILTERS( T[Domain] ),
KEEPFILTERS( VALUES( T[Region Name] ) )
)