Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I'm recreating a matrix from Excel into Power BI, and attempting to match the formatting as much as possible. There's a fairly simple matrix in it, with values something like this:
I would like to display these values as a fraction of the row total, updating with new data as it comes in. ie:
I've managed to get the inverse, where it shows the values as a fraction of the column total, by using the following DAX:
Table Output = COUNT('Sample Data'[X-values]) & "/" & CALCULATE(COUNTA('Sample Data'[X-values]), ALLSELECTED('Sample Data'[Y-values]))Leading to this close, but incorrect, table:
But when I swap X-values and Y-values in the CALCULATE, I don't get the desired row totals; I get each value just divided by itself (10/10, 9/9, 22/22, etc.)
How can I get these to display with the sum of the row as their denominator, instead of the sum of the column?
Solved! Go to Solution.
@Nankaina add following two measures:, and use display measure in the matrix visual
Sum Measure = SUM ( YourTable[YourColumn] )
Display Measure =
FORMAT ( [Sum Measure], "#" ) & "/" &
FORMAT ( CALCULATE ( [Sum Measure], ALLSELECTED ( YourTable[X-ValueColumn] ) ), "#" )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
As @Nankaina just answered, you should adjust the meassure called Table Output taking into account all the [X-values] and not the [Y-values] in the ALLSELECTED formula.
ALLSELECTED('Sample Data'[X-values])
Table Output CORRECT= COUNT('Sample Data'[X-values]) & "/" & CALCULATE(COUNTA('Sample Data'[X-values]), ALLSELECTED('Sample Data'[X-values])
## Actual Meassure (wrong):
## Table Output = COUNT('Sample Data'[X-values]) & "/" & CALCULATE(COUNTA('Sample Data'[X-values]), ALLSELECTED('Sample Data'[Y-values])
@Nankaina add following two measures:, and use display measure in the matrix visual
Sum Measure = SUM ( YourTable[YourColumn] )
Display Measure =
FORMAT ( [Sum Measure], "#" ) & "/" &
FORMAT ( CALCULATE ( [Sum Measure], ALLSELECTED ( YourTable[X-ValueColumn] ) ), "#" )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 72 | |
| 70 | |
| 39 | |
| 34 | |
| 23 |