Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
KimmoS
New Member

How to construct a dynamic Coefficient of Variation in PowerBI Desktop?

Hello!
I guess I am not the first one with problem like this but I really get no further than getting the constant value which is based on the whole dataset DRG_data. There are something like 3M rows and Cost has no null values and only some zeroes. There are some slicers but after slicing there still are quite big subgroups.

 

How to fix my code? Any advice is helpful.

 

CoefVariation =
VAR SelectedCost = VALUES('DRG_data'[Cost])
VAR FilteredTable = CALCULATETABLE('DRG_data', 'DRG_vertailu'[Cost] IN SelectedCost)
VAR MeanKustannus = AVERAGE('DRG_data'[Cost])
VAR StdDevKustannus = STDEV.S('DRG_data'[Cost])
RETURN
IF(
ISBLANK(MeanCost) || MeanCost = 0 || StdDevCost = 0,
BLANK(),
DIVIDE(StdDevKustannus, ABS(MeanKustannus)) * 100
)

 

With Regards,
Kimmo

2 REPLIES 2
KimmoS
New Member

Thank you for your answer.

I would like to send the link, but data belongs to a customer, so I am not able to share it. Could you propose a link to a web page etc... where somebody has had same kind of issues? My problem is that somehow filtering only has effect on visualisation.

Can I somehow refer to Tab where my visaulisation is or is there a way?

With Regards,
Kimmo Sivonen

Fowmy
Super User
Super User

@KimmoS 

Sharing a dummy Power BI file representing your scenario would be beneficial. You can save the Power BI file on Google Drive or any other cloud storage platform and provide the link here. Kindly ensure that permission is granted to open the file.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.