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.
Hours Online | Date | Location | Days Online | Production |
0 | 1/1/2017 | A | 0 | 0 |
0 | 1/2/2017 | A | 0 | 0 |
12 | 1/3/2017 | A | 1 | 5 |
24 | 1/4/2017 | A | 2 | 10 |
24 | 1/5/2017 | A | 3 | 5 |
24 | 1/6/2017 | A | 4 | 20 |
0 | 1/8/2017 | B | 0 | 0 |
0 | 1/9/2017 | B | 0 | 0 |
0 | 1/10/2017 | B | 0 | 0 |
24 | 1/11/2017 | B | 1 | 5 |
24 | 1/12/2017 | B | 2 | 5 |
5 | 1/13/2017 | B | 2 | 5 |
10 | 1/14/2017 | B | 2 | 10 |
24 | 1/15/2017 | B | 3 | 20 |
The first 3 columns is what i have, and the 4th column is what i would like to calculate.
Basically, i want to convert the 'hours online' values into a 'days online'. im trying to get a calculation that will sum all the hours, and only add 1 day to the to the 'days online' value if the sum is 24.
I am trying to plot 'Days online' on the x axis, and 'Production' on the Y-axis - for both locations, so that i can compare how each location performs relative to each other.
Solved! Go to Solution.
HI @aar0n
Try this Calculated Column
Column = VAR myDaysOnline = CALCULATE ( COUNTROWS ( TableName ), FILTER ( ALLEXCEPT ( TableName, TableName[Location] ), TableName[Hours Online] = 24 && TableName[Date] <= EARLIER ( TableName[Date] ) ) ) RETURN IF ( ISBLANK ( myDaysOnline ), 0, myDaysOnline )
HI @aar0n
In that case use this Column
Column = VAR CumulativeHours = CALCULATE ( SUM ( TableName[Hours Online] ), FILTER ( ALLEXCEPT ( TableName, TableName[Location] ), TableName[Date] <= EARLIER ( TableName[Date] ) ) ) RETURN ROUNDDOWN ( DIVIDE ( CumulativeHours, 24 ), 0 )
HI @aar0n
Please could you try this
Just Replaced ROUNDDown with QUOTIENT
Column = VAR CumulativeHours = CALCULATE ( SUM ( TableName[Hours Online] ), FILTER ( ALLEXCEPT ( TableName, TableName[Location] ), TableName[Date] <= EARLIER ( TableName[Date] ) ) ) RETURN QUOTIENT ( CumulativeHours, 24 )
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |