Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
RevD
Frequent Visitor

Get the Average from a column without filters

Need help on the below data. i want the ClothsWeight and HomeWeight to be appearing for all the rows. Without having any filters on it. I tried allexcept , All But it is not working. Below is the code i have now 

 

HomeWeight = CALCULATE(
    AVERAGE(Sheet3[WeightedValue]),
    Sheet3[Type] IN { "home" }
)

 

Capture.PNG

 

QuarterTypeWeightedValueindexfilterGroups
Q2 2019Cloths0.411PersonT2T
Q2 2019cloths0.412PersonT2T
Q2 2019cloths0.413PersonT2T
Q2 2019Home0.054PersonB2B
Q2 2019Home0.055OwnerB2B
Q2 2019Home0.056ownerB2B
Q2 2019Home0.057PersonB2B
Q2 2019Vehicle0.548PersonB2B
Q2 2019Vehicle0.549ownerT2T
Q3 2020cloths0.4510ownerT2T
Q3 2020cloths0.4511ownerB2B
Q3 2020Home0.0512PersonB2B
Q3 2020Home0.0513PersonB2B
Q3 2020Home0.0514ownerB2B
Q3 2020Home0.0515ownerB2B
Q3 2020Vehicle0.516PersonT2T
5 REPLIES 5
ryan_mayu
Super User
Super User

@RevD 

please try this

Measure = CALCULATE(AVERAGE('table'[WeightedValue]),FILTER(ALL('table'),'table'[Type]="Home"))

Measure2 = CALCULATE(AVERAGE('table'[WeightedValue]),FILTER(ALL('table'),'table'[Type]="cloths"))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




With that measure i am getting the overall Average value. But i want the below output

 

For Q2 2019 Cloths i want .41 in all rows for clothsWeight

For Q2 2019 Home i want .05 in all rows  for HomeWeight

For Q3 2020 Cloths i want .45 in all rows for clothsWeight

For Q3 2020 Home i want .05 in all rows  for HomeWeight

@RevD 

pls try this

Measure2 = CALCULATE(AVERAGE('table'[WeightedValue]),FILTER(ALLEXCEPT('table','table'[Quarter]),'table'[Type]="cloths"))

1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




The Solution is working for measures for same table. I have an additional measures for which i use date table and get Quarter from it for previous Quarter calculation. In the Relationship i join on the Column DateCustom with Values 4/1/2019 and 7/1/2019. for Q2 2019 AND Q3 2019. 

In the Visual i use YearQuarter from Dim Date 

Dim Date = CALENDAR(date(2019,1,1),date(2021,12,31))

CLOTHSWeight = CALCULATE(AVERAGE(Sheet3[WeightedValue]),FILTER(ALLEXCEPT('Sheet3',Sheet3[Quarter]),Sheet3[Type]="cloths")). I t gives me overall total again 
 
Thanks for the help

@RevD 

I didn't create full calendar just quarter

1.PNG

Measure = CALCULATE(AVERAGE('table'[WeightedValue]),FILTER(ALLEXCEPT('table','table'[Quarter],DIMTIME[Quarter]),'table'[Type]="cloths"))

2.PNG

please try if this works for u.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.