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 guys, i need a help!
I'd like to receive the average from the two last Mondays in my month and fill the current Monday. It will be a kind of forecast in my business case. At the moment, i have the average of days, but i dont know how to get the average in a calculated column. Follow example below. Any help is appreciated.
Solved! Go to Solution.
Hi @Anonymous,
You can create a measure below:
Measure = VAR CurrentDate = MAX ( 'Table1'[Data Venda] ) VAR MinDate = CALCULATE ( MIN ( 'Table1'[Data Venda] ), FILTER ( ALLSELECTED ( Table1 ), MONTH ( 'Table1'[Data Venda] ) = MONTH ( CurrentDate ) ) ) RETURN IF ( CurrentDate = MinDate, CALCULATE ( AVERAGE ( Table1[Total Vendas] ), FILTER ( ALLSELECTED ( 'Table1' ), WEEKNUM ( 'Table1'[Data Venda] ) >= WEEKNUM ( CurrentDate ) - 2 && WEEKNUM ( 'Table1'[Data Venda] ) < WEEKNUM ( ( CurrentDate ) ) ) ), BLANK () )
Best Regards,
Qiuyun Yu
Hi @Anonymous,
You can create a measure below:
Measure = VAR CurrentDate = MAX ( 'Table1'[Data Venda] ) VAR MinDate = CALCULATE ( MIN ( 'Table1'[Data Venda] ), FILTER ( ALLSELECTED ( Table1 ), MONTH ( 'Table1'[Data Venda] ) = MONTH ( CurrentDate ) ) ) RETURN IF ( CurrentDate = MinDate, CALCULATE ( AVERAGE ( Table1[Total Vendas] ), FILTER ( ALLSELECTED ( 'Table1' ), WEEKNUM ( 'Table1'[Data Venda] ) >= WEEKNUM ( CurrentDate ) - 2 && WEEKNUM ( 'Table1'[Data Venda] ) < WEEKNUM ( ( CurrentDate ) ) ) ), BLANK () )
Best Regards,
Qiuyun Yu
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 |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |