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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
bs1cad
Frequent Visitor

Sum unique values daily values

Hi there,

 

I have a simple table of date and unique logins. 

 

Date                Unique Logins

01/01/18         12

02/01/18         18

03/01/18         10 

 

The unique login column is a dcount of a user ID. What I need is to be able to sum the daily unique number (so 40 in the example) but the total in the table above would give the dcount over the 3 days so would be less than 40. Is there a measure I can use to calculate this? I would like to dispay as a KPI to give a running total as well as a breakdown by day like in the table above.

 

Thanks,

Chris

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

HI @bs1cad,

 

You can try to use below formula if it works on your side:

 

unique logins =
CALCULATE ( DISTINCTCOUNT ( Table[User ID] ), VALUES ( Table[Date] ) )

If above not help, please share some sample data and expected result to help us clarify your requirement and coding formula.

 

Notice:

if your formula contains use max or other similar summary function to get current row as condition to calculate distinct count, it not work properly on total row.

You need to use functions who can return corresponding row contents on each level to instead.(single row content on row level, and return summary records on total level)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

Try this measure

 

=IF(HASONEVALUE(Calendar[Date]),DISTINCTCOUNT(Data[User ID]),SUMX(SUMMARIZE(VALUES(Calendar[Date]),[Date],"ABCD",DISTINCTCOUNT(Data[User ID])),[ABCD]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-shex-msft
Community Support
Community Support

HI @bs1cad,

 

You can try to use below formula if it works on your side:

 

unique logins =
CALCULATE ( DISTINCTCOUNT ( Table[User ID] ), VALUES ( Table[Date] ) )

If above not help, please share some sample data and expected result to help us clarify your requirement and coding formula.

 

Notice:

if your formula contains use max or other similar summary function to get current row as condition to calculate distinct count, it not work properly on total row.

You need to use functions who can return corresponding row contents on each level to instead.(single row content on row level, and return summary records on total level)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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