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.
I am trying to create a calculated matrix in Power BI.
Here is my source data:
Here is what I am able to get to currently. Note Balance_1 is based on filtering to Version One. Balance_2 is based on filtering to Version Two. The users need to be able to filter between versions. I then do a measure calculation in the explanation column.
How can I then summarize this view similar to the below?
Solved! Go to Solution.
Hi @Anonymous ,
Please check:
1. Enter data to make an Explannation table.
2. Sort by [Explanation] column by [Order] column.
3. Create measures like so:
Balance_1_Sum =
VAR t =
SUMMARIZE (
'Table',
'Table'[Customer],
'Table'[ID],
"Balance1", [Balance_1],
"Balance2", [Balance_2],
"Explanation_", [Explanation]
)
RETURN
SUMX (
FILTER ( t, [Explanation_] = SELECTEDVALUE ( Explanation[Explanation] ) ),
[Balance1]
)
Delta_Sum =
VAR t =
SUMMARIZE (
'Table',
'Table'[Customer],
'Table'[ID],
"Balance1", [Balance_1],
"Balance2", [Balance_2],
"Explanation_", [Explanation],
"Delta_", ABS ( [Balance_2] - [Balance_1] )
)
RETURN
SUMX (
FILTER ( t, [Explanation_] = SELECTEDVALUE ( Explanation[Explanation] ) ),
[Delta_]
)
4. Create a Table visual like so:
BTW, .pbix file attached.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please check:
1. Enter data to make an Explannation table.
2. Sort by [Explanation] column by [Order] column.
3. Create measures like so:
Balance_1_Sum =
VAR t =
SUMMARIZE (
'Table',
'Table'[Customer],
'Table'[ID],
"Balance1", [Balance_1],
"Balance2", [Balance_2],
"Explanation_", [Explanation]
)
RETURN
SUMX (
FILTER ( t, [Explanation_] = SELECTEDVALUE ( Explanation[Explanation] ) ),
[Balance1]
)
Delta_Sum =
VAR t =
SUMMARIZE (
'Table',
'Table'[Customer],
'Table'[ID],
"Balance1", [Balance_1],
"Balance2", [Balance_2],
"Explanation_", [Explanation],
"Delta_", ABS ( [Balance_2] - [Balance_1] )
)
RETURN
SUMX (
FILTER ( t, [Explanation_] = SELECTEDVALUE ( Explanation[Explanation] ) ),
[Delta_]
)
4. Create a Table visual like so:
BTW, .pbix file attached.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Create two tables like this
Version 1 = distinct(Table[Version])
Version 2 = distinct(Table[Version])
Do not join it with table back
Try like
Balanace_1 =
var _max = allselected(Version1[Version]) // or Values(Version1[Version])) // or selectedvalues(Version1[Version]))
return
calculate(sum(Table[Balance]),Table[Version] in _max)
Balanace_2 =
var _max = allselected(Version2[Version]) // or Values(Version1[Version])) // or selectedvalues(Version1[Version]))
return
calculate(sum(Table[Balance]),Table[Version] in _max)
diff =
Switch(Ture(),
[Balanace_1] - [Balanace_2] =0 ,"No Change",
[Balanace_1] - [Balanace_2] >0 ,"Increase",
[Balanace_1] - [Balanace_2] <0 ,"Decrease",
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |