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.
Can we assign a value, which is not an aggregation of other values in the subsection of the matrix visualization.
eg. in the below table, the yellow cells are not sum, average, or any other calculation from other values in the column, but a target value defined by business..
Solved! Go to Solution.
You could use a measure for the second column and use the ISINSCOPE() function to determine what value to use. For example, I created the following 2 tables in PBI (also: please never post pictures of tables because now we have to recreate it for you):
Country | Person | Actual Sales | Target Sales |
USA | Person1 | 150 | 150 |
USA | Person2 | 160 | 130 |
USA | Person3 | 120 | 140 |
Canada | Person1 | 200 | 250 |
Canada | Person2 | 100 | 200 |
Canada | Person3 | 150 | 150 |
Mexico | Person1 | 100 | 120 |
Mexico | Person2 | 100 | 130 |
Mexico | Person3 | 100 | 140 |
Country | Target Sales | ||
USA | 350 | ||
Canada | 540 | ||
Mexico | 360 |
I then created the following measure, which looks at the current context and determines if it is evaluated in a Country context of Person context. If it is the first case, than it will lookup the corresponding sales target in the second table, otherwise it will sum the Sales[Target Sales] column:
TargetSalesMeasure =
SWITCH( TRUE(),
ISINSCOPE(Sales[Person]), SUM(Sales[Target Sales]),
LOOKUPVALUE(CountryTargets[Target Sales], CountryTargets[Country], SELECTEDVALUE(Sales[Country])))
This results in the following matrix:
Neat stuff huh? 🙂 Let me know if this answers your question!
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Proud to be a Super User!
You could use a measure for the second column and use the ISINSCOPE() function to determine what value to use. For example, I created the following 2 tables in PBI (also: please never post pictures of tables because now we have to recreate it for you):
Country | Person | Actual Sales | Target Sales |
USA | Person1 | 150 | 150 |
USA | Person2 | 160 | 130 |
USA | Person3 | 120 | 140 |
Canada | Person1 | 200 | 250 |
Canada | Person2 | 100 | 200 |
Canada | Person3 | 150 | 150 |
Mexico | Person1 | 100 | 120 |
Mexico | Person2 | 100 | 130 |
Mexico | Person3 | 100 | 140 |
Country | Target Sales | ||
USA | 350 | ||
Canada | 540 | ||
Mexico | 360 |
I then created the following measure, which looks at the current context and determines if it is evaluated in a Country context of Person context. If it is the first case, than it will lookup the corresponding sales target in the second table, otherwise it will sum the Sales[Target Sales] column:
TargetSalesMeasure =
SWITCH( TRUE(),
ISINSCOPE(Sales[Person]), SUM(Sales[Target Sales]),
LOOKUPVALUE(CountryTargets[Target Sales], CountryTargets[Country], SELECTEDVALUE(Sales[Country])))
This results in the following matrix:
Neat stuff huh? 🙂 Let me know if this answers your question!
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Proud to be a Super User!
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 |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |