Calculating True AVG of column with same value

Hi,
Am I missing something or misusing something? I have this beastmode to calculate the True average of a column called Days_In_Service, however it just appears to be adding up the distinct values and not dividing them. If the Unit# is the same then the days_in_service will be the same. I am trying to avoid the situation where if the days_in_service are the same but have different unit# then the days_in_service wont be counted due to using distinct.
Any help is appreciated, Thank you!
Here is the beastmode. The output for this beastmode is 29,150 instead of 14,575.
SUM(DISTINCT Days_In_Service
) OVER (PARTITION BY Unit#
) / COUNT(DISTINCT Unit#
)
Here is a snippet of my data.
Best Answer
-
SUM(MAX(
Days_In_Service
) FIXED(BYUnit#
)) / COUNT(DISTINCTUnit#
)If I solved your problem, please select "yes" above
0
Answers
-
SUM(MAX(
Days_In_Service
) FIXED(BYUnit#
)) / COUNT(DISTINCTUnit#
)If I solved your problem, please select "yes" above
0
Categories
- All Categories
- Product Ideas
- 2.1K Ideas Exchange
- Connect
- 1.3K Connectors
- 309 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 663 Datasets
- 119 SQL DataFlows
- 2.3K Magic ETL
- 823 Beast Mode
- Visualize
- 2.6K Charting
- 86 App Studio
- 46 Variables
- Automate
- 194 Apps
- 483 APIs & Domo Developer
- 87 Workflows
- 23 Code Engine
- AI and Machine Learning
- 23 AI Chat
- 4 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 117 Domo Everywhere
- 283 Scheduled Reports
- 11 Software Integrations
- Manage
- 143 Governance & Security
- 11 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 116 Community Announcements
- 5K Archive