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.
Hi team,
I have Date and Value columns coming from one table, and I need a new calculated column to show the total sum of the values by date.
Date&Time | Value | Needed result (SUM by date) | Result #2 |
01.01.2022 12:01:00 AM | 5 |
| 15 |
01.01.2022 15:00:00 PM | 10 | 15 | 15 |
02.02.2022 01:00:00 AM | 20 |
| 50 |
02.02.2022 05:00:00 AM | 20 |
| 50 |
02.02.2022 10:00:00 PM | 10 | 50 | 50 |
03.02.2022 11:00:00 AM | 2 |
| 5 |
03.02.2022 11:15:00 AM | 3 | 5 | 5 |
I tried this Dax calculation, but it didn’t work:
Total_SUM = CALCULATE (SUM ( ‘Table1[Value]), FILTER ( ALL ('Table1), ‘Table1[Date&Time] <= MAX (' Table1[Date&Time])))
I will appreciate the help.
Solved! Go to Solution.
@EmaVasileva So, make the following tweak in that measure:
Result1= CALCULATE(SUM(TableName[ValuesColumn]),ALLEXCEPT(TableName,TableName[Date_]),TableName[Task Desc]="MO"))
This worked for me
Column = CALCULATE(SUM(Table1[Value]),Table1[Date&Time]).
@EmaVasileva Follow the below steps to get the result.
Step 1: Create below column which only extract the Date part from your date column.
Hi @Tahreem24 ,
Thank you for your response. As I just mention, currently, I have an additional filter for my whole table (apologies for not mentioning it before). The column is Task Description - "AM", "MO", and my table is filtering to show dates and values only for Task desc. = "MO".
By using your formula I received the sum of all values for a day (AM & MO). The filter applied to myreport page didn't affect the new Calc. column.
Is it possible the "New column" to show the sum of values only where the Task Desc = "MO".
Thank you.
@EmaVasileva So, make the following tweak in that measure:
Result1= CALCULATE(SUM(TableName[ValuesColumn]),ALLEXCEPT(TableName,TableName[Date_]),TableName[Task Desc]="MO"))
Hi @amitchandak ,
Thank you for your response. Currently, I have an additional filter for my whole table (apologies for not mentioning it before). The column is Task Description - "AM", "MO", and my table is filtering to show dates and values only for Task desc. = "MO".
By using your formula I received the sum of all values for a day (AM & MO). The filter applied to myreport page didn't affect the new Calc. column.
Is it possible the "New column" to show the sum of values only where the Task Desc = "MO".
Thank you.
@EmaVasileva , New columns
new column =
var _date = datevalue([Date&Time])
return
sumx(filter(Table, datevalue([Date&Time]) = _date ), [Value])
new column =
var _date = datevalue([Date&Time])
var _max = maxx(filter(Table, datevalue([Date&Time]), [Date&Time])
return
if([Date&Time] =_max, sumx(filter(Table, datevalue([Date&Time]) = _date ), [Value]), blank())
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
103 | |
101 | |
87 | |
73 | |
67 |
User | Count |
---|---|
119 | |
111 | |
95 | |
79 | |
72 |