March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello all!
I have found lots of similar answers to similar questions on the forums already, but none seem to work so hoping someone could help me out.
I have the following matrix visualisation which I use drop down menus to filter.
I wish to compare the different runs, which make up my column variable, and then filter those by my other variables for more detail. I would mainly like my total column to be replaced by an averages column and then have additional columns side by side with the differences between that run and the average.
I understand the basics of measures and have had plenty of attempts at making my own average column, but when I use DAX like:
Solved! Go to Solution.
Going to drop my solution in here ion case anyone with a similar problem comes across it in the future:
For me it was as simple as :
TotalSum = Sum(TableName[Value])
RunsSelected = Countrows(Distinct(AllSELECTED(TableName[Runs])))
SumOverRuns = Calculate( [TotalSum] , ALLSELECTED(TableName[Runs]))
AverageOverRuns = Divide(SumOverRuns , RunsSelected)
@EHa , is filtered or is in scope should help
https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/
or see this formula can help
averageX(summarize(table,table[location], table[stat],"_1",Calculate(SUM(TestData[Value]),TestData[Run])) ,[_1])
Hi @amitchandak ,
Thanks for the quick reply , I will definitely have a proper explore of the isfiltered function today.
I did try your test code (with both table and testdata changed to Sheet1 ,which is the name of the table in my report at the moment)
It doesn't seem to do what I want however:
Idon't fully understand what it is doing in every position, but it seems to do exactly what I want for London and Paris totals, but not for the Mean and SD as it is dividing the totals by 1 and not 2. Is there a way to slightly edit this so it works do you think?
Additionally, once this is done, is there a way to only keep the final column / turn the others to differences?
Thanks a lot for your help,
EHa
Going to drop my solution in here ion case anyone with a similar problem comes across it in the future:
For me it was as simple as :
TotalSum = Sum(TableName[Value])
RunsSelected = Countrows(Distinct(AllSELECTED(TableName[Runs])))
SumOverRuns = Calculate( [TotalSum] , ALLSELECTED(TableName[Runs]))
AverageOverRuns = Divide(SumOverRuns , RunsSelected)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |