The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
We have a data warehouse that connects via direct query. We have dimension tables that contains ranges of data. For example, dates ranges, income ranges, gender.
The following image contain an example Matrix visulaisation, related to an age of a person. We would like to work the overall average age value?
Selecting, the display value as an average option (the last column), gives an incorrect result.
Using excel I can work out an an average by:
How would I appraoch this within power bi desktop. This the an inbuilt option that can work out an average or would we need to use DAX to create a measure or extra column
Thanks
Perhaps a measure like:
m_MyAverage = ((SUM([AgeRangeLow])+SUM([AgeRangeHigh]/2) * COUNT([Id]))/COUNT([AgeRange])
Hi smoupre,
Your measure was useful. But, I wasn't able to get this to work.
I tried the following measure:
Mid = VAR AgeRangeMidPoint = DIVIDE( (SUM('dim AgeRanges'[Minimum]) + SUM('dim AgeRanges'[Maximum])),2 ) RETURN (AgeRangeMidPoint * COUNT('fact Calculations'[Id]))
Then used it as the last column of the following matrix visualisation:
What I would need to do is to:
Thanks
Hi @Anonymous,
According to your description above, you should be able to use the formula below to get the Sum of the measure value Mid.
TotalMid = SUMX ( SUMMARIZE ( 'dim AgeRanges', 'dim AgeRanges'[AgeRange], "abc", [Mid] ), [abc] )
Regards