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
Anonymous
Not applicable

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 @Anonymous,

 

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 @Anonymous,

 

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