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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
jwessel
Helper II
Helper II

Count differences between Total card and monthly vis

I have a clustered column chart with data count labels on each bar, representing count of "cases" each day of a month.  I also have a card which shows the total cases for that month.  The issue I am having is that when I manually sum the values on each day's bar, it does NOT total up to the value that is on the card.  For example, the columns manually totaled up for May come to a value of 2579.  However, the Card value shows 2573.  I cannot see that I have anything incorrect.  Does anyone have any ideas?  I have included a picture below.  I also share a link to the .pbix file here.  

 

jwessel_0-1657902357381.png

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @jwessel ,

 

These results are logically correct. In the clustered column chart, each bar counts the distinct number of cases in that day. The card visual distinct count the total case. However just as @evandrocunico  mentioned before, when you have the same case in different days, the sum value of each day's bar is different from total case number.

I have created different measures to help you calculate, please try:

Measure 1 = CALCULATE(DISTINCTCOUNT(CMS[Case #]),FILTER('Dates',[FYMonth]=MAX('Dates'[FYMonth])))

Output:

vjianbolimsft_0-1658293278672.png

 

Measure 2 = CALCULATE(DISTINCTCOUNT(CMS[Case #]),FILTER('Dates',[FYMonth]=MAX('Dates'[FYMonth]) && [Day]=MAX('Dates'[Day])))

 

Measure 3 = SUMX('Dates',[Measure 2])

Output:

vjianbolimsft_1-1658293278678.png

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
jwessel
Helper II
Helper II

Again, my appreciation for the input.  It turns out that there are some Case #s which are present in my data on multiple days.  This was not expected and exposes a potential anomaly in our system.  Thanks !!

jwessel
Helper II
Helper II

Thank you immensely for that information.  I will check the data.  Technically, a single case (case #) should not exist on two separate days/dates.

v-jianboli-msft
Community Support
Community Support

Hi @jwessel ,

 

These results are logically correct. In the clustered column chart, each bar counts the distinct number of cases in that day. The card visual distinct count the total case. However just as @evandrocunico  mentioned before, when you have the same case in different days, the sum value of each day's bar is different from total case number.

I have created different measures to help you calculate, please try:

Measure 1 = CALCULATE(DISTINCTCOUNT(CMS[Case #]),FILTER('Dates',[FYMonth]=MAX('Dates'[FYMonth])))

Output:

vjianbolimsft_0-1658293278672.png

 

Measure 2 = CALCULATE(DISTINCTCOUNT(CMS[Case #]),FILTER('Dates',[FYMonth]=MAX('Dates'[FYMonth]) && [Day]=MAX('Dates'[Day])))

 

Measure 3 = SUMX('Dates',[Measure 2])

Output:

vjianbolimsft_1-1658293278678.png

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

evandrocunico
Resolver III
Resolver III

Hello!!!

 

Try check the same value in distinct days.

 

 

evandrocunico_0-1657913592074.png

 

Best regards.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.