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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Sankzpower
Helper I
Helper I

Countif complications in power bi

Hi guys

 

Here is my attached Sample file. My table contains customername, split by dates and values for each day. What I would like it to show is that count number of days (i.e) a simple count(date) and average the total value by customer where its greater than 0. Then count the number of days where the value is greater than the average. 

 

I have completed this task in excel (this is also shown in the attached file and below ) but doing in power bi is a challenge for me. Can someone please help me?

 

CustomerCountdaysAverage total>0Countif > than averageResult - Data Coverage
A9243.8355%
B99380.771515%
C240755.928335%
D57802.671933%

Thanks

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Sankzpower 

dont understand how do you calculate Result - Data Coverage, but for other columns try measures:

Average total > 0 = calculate(AVERAGE(Table1[value]);allexcept(Table1;Table1[customer.name]);Table1[value]>0)

and

Countif > than average = calculate(countrows(FILTER(Table1;Table1[value]>[Average total > 0])))

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

2 REPLIES 2
az38
Community Champion
Community Champion

Hi @Sankzpower 

dont understand how do you calculate Result - Data Coverage, but for other columns try measures:

Average total > 0 = calculate(AVERAGE(Table1[value]);allexcept(Table1;Table1[customer.name]);Table1[value]>0)

and

Countif > than average = calculate(countrows(FILTER(Table1;Table1[value]>[Average total > 0])))

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thanks @az38 . It did not work exactly to what I needed but your code gave me another idea which had worked. 

 

Cheers.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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