Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a matrix where I'm sumarizing by Project and Discipline. The Adjusted Bid Factor values in the Matrix are reading from different What If sliders and displaying those selected results at the row level. I want the Totals in the Matrix to show the average value at Project 1 and Project 2 and finally for the Total.
I expect Project 1's total to be 0.75. Project 2 to be 1.0, and the Total row to be 0.88.
Below is my sample code displaying the Adjusted Bid Factor column using the AVERAGEX
_Bid Factor (Selected) AVGX =
//AVERAGEX('WbsCode Forecast',[_Bid Factor (Selected)])
IF ( HASONEFILTER('WbsCode Forecast'[WbsCode.Discipline.name] ),
'WbsCode Forecast'[_Bid Factor (Selected)],
IF(
HASONEFILTER(Jobs[JobName] ),
AVERAGEX('WbsCode Forecast', 'WbsCode Forecast'[_Bid Factor (Selected)]),
CALCULATE(
AVERAGEX( ALLSELECTED(Jobs[JobName] ), 'WbsCode Forecast'[_Bid Factor (Selected)])
)
)
)
Below is my Bid Factor Selected DAX,
_Bid Factor (Selected) =
// Pre-req DAX for the _Bid Factor (Selected) AVGX measure.
// Displays the What If selected value for each of the corresponding Disciplines
VAR ShowSelected =
SWITCH( TRUE(),
CONTAINSSTRING( SELECTEDVALUE('WbsCode Forecast'[WbsCode.Discipline.name]),"PLI"), SELECTEDVALUE('PLI Bid Factor'[PLI Bid Factor]),
CONTAINSSTRING( SELECTEDVALUE('WbsCode Forecast'[WbsCode.Discipline.name]),"PLF"), SELECTEDVALUE('PLF Bid Factor'[PLF Bid Factor]),
CONTAINSSTRING( SELECTEDVALUE('WbsCode Forecast'[WbsCode.Discipline.name]),"PFI"), SELECTEDVALUE('PFI Bid Factor'[PFI Bid Factor]),
CONTAINSSTRING( SELECTEDVALUE('WbsCode Forecast'[WbsCode.Discipline.name]),"PFF"), SELECTEDVALUE('PFF Bid Factor'[PFF Bid Factor]),
CONTAINSSTRING( SELECTEDVALUE('WbsCode Forecast'[WbsCode.Discipline.name]),"SMI"), SELECTEDVALUE('SMI Bid Factor'[SMI Bid Factor]),
CONTAINSSTRING(SELECTEDVALUE('WbsCode Forecast'[WbsCode.Discipline.name]),"SMF"), SELECTEDVALUE('SMF Bid Factor'[SMF Bid Factor]),
1
)
Var Result =
IF(ISINSCOPE('WbsCode Forecast'[WbsCode.Discipline.name]),ShowSelected,0) //Displays the rollup value for the Bid Factor starting at the WBS level
Return
Result
Can someone help me remedy the Total values in the matrix to show the average instead of what it currently is?
@thomazinh This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Also, this may come in handy as well, MM3TR&R: Matrix Measure Total Triple Threat Rock & Roll - Microsoft Power BI Community
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 54 | |
| 46 | |
| 44 | |
| 20 | |
| 19 |
| User | Count |
|---|---|
| 73 | |
| 71 | |
| 34 | |
| 33 | |
| 31 |