cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LionelMaximus
Regular Visitor

Sum of Count

Hi!

 

I am using a Count Measure in my powerBI report and it shows the correct result but whenever i drop the date with the measure it does not aggregate the values and shows count in each date.

e.g. in the below image Date is repeating i want to see the sum in each date.how is it possible?

Measure i am using = 

VAR A = CALCULATE(COUNT('Table'[PersonId]),FILTER('Table','Table'[STATUS]="Completed"))
RETURN
IF(ISBLANK(A),0,A)

Capture.PNG

 
1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@LionelMaximus


Try just put date and this measure in the table visual, you have other fields so the count measure are not summarized. You may also add allselected() to the expression and try.

 

Meausre = 

VAR A = CALCULATE(COUNT('Table'[PersonId]),FILTER(Allselected('Table'),'Table'[STATUS]="Completed"))
RETURN
IF(ISBLANK(A),0,A)

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@LionelMaximus


Try just put date and this measure in the table visual, you have other fields so the count measure are not summarized. You may also add allselected() to the expression and try.

 

Meausre = 

VAR A = CALCULATE(COUNT('Table'[PersonId]),FILTER(Allselected('Table'),'Table'[STATUS]="Completed"))
RETURN
IF(ISBLANK(A),0,A)

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

daxer
Solution Sage
Solution Sage

This is what your measure should look like:

daxer_0-1620304113019.png

Secondly, I can't tell you why you get what you get since I can't see the model.

 

By the way, having a model with one table only where you store all your data is a very bad idea. Please get familiar with the principles of data modeling for Power BI: Understand star schema and the importance for Power BI - Power BI | Microsoft Docs

themistoklis
Super User II
Super User II

@LionelMaximus 

 

There can be various reasons why this is happening. Best if you could share the file with us.

 

Otherwise you can try the SUMX formula:

 

VAR A = SUMX(ALL(Table), CALCULATE(COUNT('Table'[PersonId]),FILTER('Table','Table'[STATUS]="Completed")))

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Top Solution Authors
Top Kudoed Authors