The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi ,
Am new to this community.
My need is to calculate the average of first 15 workmenship value based on the index column.
If you see the index its starts from 1 to 24 (this no is not static it will change)for domestic bedding and again index starts from 1 for import bedding.
So I have to calculate the average of first fifteen for domestic and the avarage of 15 values must apply to all the domestic bedding i.e till index 24.
Next I have to recalculate the average of first fifteen for import bedding and now the avarage of 15 values must apply to all the import bedding i.e till index 28.
I have done this calcultion in Excel.I need this to be done in Power BI.
I have attached the full excel sheet.
Please help me to do with this,
Thanks in Advance,
Mohammed Raffi.
Can anyone please help me on this.....
Hi @Anonymous ,
Please try to use following measure formula if it works for your requirement:
Measure = VAR currIndex = MAX ( Table[Index] ) VAR maxIndex = CALCULATE ( MAX ( Table[Index] ), ALLSELECTED ( Table ), VALUES ( Table[Division] ), VALUES ( Table[Finance Division] ) ) VAR _start = IF ( maxIndex - currIndex >= 14, currIndex, maxIndex - 14 ) RETURN CALCULATE ( AVERAGE ( Table[Price] ), FILTER ( ALLSELECTED ( Table ), [Index] >= _start && [Index] < _start + 15 ), VALUES ( Table[Division] ), VALUES ( Table[Finance Division] ) )
Regards,
Xiaoxin Sheng
Hi @Anonymous ,
Actually, your snapshots seems broken. Can you please share more data information to help us clarify your requirement?
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Am new to this community.
My need is to calculate the average of first 15 workmenship value based on the index column.
If you see the index its starts from 1 to 24 (this no is not static it will change)for ABC1 and again index starts from 1 for ABC2.
So I have to calculate the average of first fifteen for ABC1 and the avarage of 15 values must apply to all the ABC1 i.e till index 24.
Next I have to recalculate the average of first fifteen for ABC2 and now the avarage of 15 values must apply to all the ABC2 i.e till index 28.
I have done this calcultion in Excel.I need this to be done in Power BI.
Please help me to do with this,
Thanks in Advance,
Mohammed Raffi.