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 all, i need your help so please! I tried a lot to find out a way but i did't manage to...so here i am.
The problem is very simple tough. With DAX i would like to find a way to calculate the average time in the same day as in the table below (AVERAGETIME_IN DAY 😞
HELP IN ADVANCE!
Solved! Go to Solution.
HI @myfirstdax
Try
= CALCULATE ( AVERAGE ( TableName[Time] ), ALLEXCEPT ( TableName, TableName[DAY] ) )
Hi @myfirstdax
This calculated column is one way. Can easily turn in a measure if you need as well
AVERATETIME_IN DAY = AVERAGEX( FILTER( 'Table', 'Table'[Day] = EARLIER('Table'[Day]) ), [Time])
if you want a measure then this is the code
Measure = CALCULATE( AVERAGE('Table'[Time]), FILTER( ALLSELECTED('Table'), 'Table'[Day] = MAX('Table'[Day])) )
I will use this in the next formulas .. I enjoyed very much this variant!
Hi all, please help me! I tried to find out a way to solve it but i can't without your help. The problem is very simple though. I would like to calculate the column "AVERAGE_TIME" as in the table below with dax formulas:
THANKS IN ADVANCE
to find with DAX!!! | |||
DAY | Supplier | Time | AVERAGETIME_IN DAY |
01/01/2018 | Supplier 4 | 10 | 11 |
01/01/2018 | Supplier 1 | 12 | 11 |
01/01/2018 | Supplier 1 | 11 | 11 |
04/01/2018 | Supplier 2 | 15 | 26 |
04/01/2018 | Supplier 3 | 17 | 26 |
04/01/2018 | Supplier 4 | 1 | 26 |
04/01/2018 | Supplier 5 | 23 | 26 |
02/01/2018 | Supplier 6 | 74 | 54 |
02/01/2018 | Supplier 3 | 34 | 54 |
Try this
= CALCULATE ( AVERAGE ( TableName[Time] ), FILTER ( ALLEXCEPT ( TableName, TableName[DAY] ), TableName[Time] > 0 ) )
for the learning purposes you can also leverage @Phil_Seamark approach by adding a second conditional to the filter with AND "&& (double ampersand)"operator. This pattern in very common.
= CALCULATE ( AVERAGE ( 'Table'[Time] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Day] = MAX ( 'Table'[Day] ) && 'Table'[Time] > 0 ) )
N -
@Zubair_Muhammad and @nickchobotar thank you very much for you advice.
Also for educational purpose the solution runs correctly
Good day all and thank your for supoort to community
HI @myfirstdax
Try
= CALCULATE ( AVERAGE ( TableName[Time] ), ALLEXCEPT ( TableName, TableName[DAY] ) )
hi, another question if you want to help me again..i would calculate the average excluding also the zero..how i could this? surely with filter but i cant' manage to nest them correctly.. thanks!!
THNAK YOU VERY MUCH! I DIDN't think to allexcept 🙂
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 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |