Hi Jheng,
The original domain for the underlying column kpi5 likely has no decimals so the result also has no decimals.
Can you verify that this is the case and add the scale to the domain?
Kind regards,
Tim de Lang
Hi Tim,
I tried to update the domain to the following data type, but all these failed to see the decimal places
- using Numeric (5,2)

- Using Float

- Using Numeric with control

The result are all the same, without exact decimals

The view table I use the average domain

Just also want to share the functionality I used, if this could help to verify

This function are used by 2 datamodel view table,
1) Kpi overview (list of data - kpi are just count of days)
2) Kpi graph (which im using the cube and getting the average of the kpi
Please advice if there’s anything I missed out to set
Thank you
Hi @Jheng,
From what I suspect, the reason it’s not showing the exact decimals is because the DATEDIFF() function in your code returns an integer value. When the cube calculates the average, it’s using integer data, so the decimals are rounded.
To fix your code, I'd say you need to cast the result of your calculation as a decimal, for example:
CAST(DATEDIFF(day, col1, col2) AS DECIMAL(10,2))
Hi @Jheng,
Did you manage to get this working based on my latest reply?