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
BharathM
Helper IV
Helper IV

Totals are not correct on Week End date

Hi Everyone

In this measure the values are getting correct on Day Wise

 

var a= CALCULATE (DISTINCTCOUNT('Table' [custNo]), 'table'[True Count]=1) 

Return

if(a=blank(),0,a)

 

Date.          Total Count 

 

12/25/2022  31

 

12/24/2022 19

 

12/23/2022 17

 

12/22/2022  20

 

12/21/2022  10

 

12/20/2022.   1

 

12/19/2022.   1

Here my requirement is i have one more slicer that was using week ending date as per the logic of week range is correct

 

So i selected date 12/25/2022

Week range is 12/19 to 12/25/2022 this correct only 

But same above measure i  used but I'm not getting the totals correctly 

 

31+19+17+20+10+1+1 = 99 this values are correct only

 

But when i select week end date 12/25/2022

 

count I'm getting 88 these are not correct but daily basis the count is correct only 

 

Weekend range date logic also correct

 

Note 

I  observed one thing here again it is distinct count on the overall week of customer no's 

 

So i dont want overall distinct on weekly i want the count of distinct customer no's on daily basis

But this totals should sum on week end date 

 

12/25/2022 count should come 99

 

Thanks In Advance 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @BharathM 

whateve your reason to force additivity over a distinctcout calculation, you may try

=
SUMX (
VALUES ( 'Date'[Date] ),
COALESCE (
CALCULATE ( DISTINCTCOUNT ( 'Table'[custNo] ), 'table'[True Count] = 1 ),
0
)
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @BharathM 

whateve your reason to force additivity over a distinctcout calculation, you may try

=
SUMX (
VALUES ( 'Date'[Date] ),
COALESCE (
CALCULATE ( DISTINCTCOUNT ( 'Table'[custNo] ), 'table'[True Count] = 1 ),
0
)
)

Hi @tamerj1 

Thanks you so much its Working 

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.

Top Solution Authors