Forum Discussion

Cgull's avatar
Cgull
Frequent Visitor
5 years ago
Solved

Measure to show zero data where no data for date

Hi,

 

We are struggling with DAX, to create a measure that puts zeros for blank values. 

Data:

Date Time                   Tokens   User

09/11/2020 00:00:0110Harry
09/11/2020 01:00:0110Harry
09/11/2020 02:00:0110Harry
09/11/2020 03:00:0110Harry
09/11/2020 04:00:0110Harry
09/11/2020 05:00:0110Harry
09/11/2020 06:00:0110Harry
09/11/2020 07:00:0110Harry
09/11/2020 08:00:0110Harry
09/11/2020 09:00:0110Harry
09/11/2020 09:00:0110Sally
09/11/2020 10:00:0110Harry
09/11/2020 10:00:0110Sally
09/11/2020 11:00:0110Harry
09/11/2020 11:00:0110Sally
09/11/2020 11:00:0120Bob
09/11/2020 12:00:0110Harry
09/11/2020 12:00:0110Sally
09/11/2020 12:00:0120Bob
09/11/2020 13:00:0110Harry
09/11/2020 13:00:0110Sally
09/11/2020 14:00:0110Harry
09/11/2020 14:00:0110Sally
09/11/2020 15:00:0110Harry
09/11/2020 16:00:0110Harry
09/11/2020 17:00:0110Harry
09/11/2020 18:00:0110Harry
09/11/2020 19:00:0110Harry
09/11/2020 20:00:0110Harry
09/11/2020 21:00:0110Harry
09/11/2020 22:00:0110Harry
09/11/2020 23:00:0110Harry
10/11/2020 00:00:0110Harry

 

Visual initially looks good, 

but when we filter by user. 

Line should go to zero at 18:00 on 09/11/2020.

We think a measure should resolve this. 

We've tried various ideas i.e.

Measure = IF((CALCULATE(SUM(Sheet3[Tokens])) < 1), 0,(CALCULATE(SUM(Sheet3[Tokens]))))

But have not succeded in the correct expression.
Happy to share pbix. if it makes it clearer.
Many thanks in advance.

5 Replies