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
LionelMaximus
Frequent 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.

Anonymous
Not applicable

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
Community Champion
Community Champion

@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
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.