Forum Discussion
Clustered Bar Chart - How to visualize both static data and calculated data together?
- 1 year ago
Replace your calculated/static table with a pure disconnected “axis”/“selection” table containing only Metric and Year (NO data values).
Calculated table will not act dynamic so you will only need to have a helper table with the combination of metric and year and not the actual values of 2025. In the suggestion above, I request using the measure defined and calculating 2025 data in real time which will make it dynamic and get reflected changing based on the slicer selection. Make sure to not include the data into the calculated table. Let me know if you need further clarification or provide sample data for further analysis.
Hi sharkrocket
You could simply have a Disconnected table and handle with the DAX measure
Your Disconnected table could look like this:
| Metric | Year |
| Denominator | Last Year |
| % Met Progress | Last Year |
| % Complete | Last Year |
| Denominator | This Year |
| % Met Progress | This Year |
| % Complete | This Year |
Have a measure like this:
UnifiedMetricValue =
SWITCH(
TRUE(),
SELECTEDVALUE(Category[Metric]) = "Denominator" && SELECTEDVALUE(Category[Year]) = "Last Year", 12345, -- static value
SELECTEDVALUE(Category[Metric]) = "% Met Progress" && SELECTEDVALUE(Category[Year]) = "Last Year", 0.76, -- static value
SELECTEDVALUE(Category[Metric]) = "% Complete" && SELECTEDVALUE(Category[Year]) = "Last Year", 0.45, -- static value
SELECTEDVALUE(Category[Metric]) = "Denominator" && SELECTEDVALUE(Category[Year]) = "This Year", [Denominator Measure],
SELECTEDVALUE(Category[Metric]) = "% Met Progress" && SELECTEDVALUE(Category[Year]) = "This Year", [% Met Progress Measure],
SELECTEDVALUE(Category[Metric]) = "% Complete" && SELECTEDVALUE(Category[Year]) = "This Year", [% Complete Measure]
)
In place of static value you could also refer to the column or table where this is instead or even use lookup if the metric is present in both the table depending on how your table looks
Example using Lookup:
UnifiedMetricValue =
VAR Metric = SELECTEDVALUE(Category[Metric])
VAR Year = SELECTEDVALUE(Category[Year])
RETURN
SWITCH(
TRUE(),
Year = "Last Year",
LOOKUPVALUE(LastYearMetrics[Value], LastYearMetrics[Metric], Metric),
Year = "This Year" && Metric = "Denominator", [CY_Denominator],
Year = "This Year" && Metric = "% Met Progress", [CY_MetProgress],
Year = "This Year" && Metric = "% Complete", [CY_Complete]
)Thank you for your reply. I think that's pretty similar to what I did. My code was:
- MohamedFowzan11 year ago
Super User
Replace your calculated/static table with a pure disconnected “axis”/“selection” table containing only Metric and Year (NO data values).
Calculated table will not act dynamic so you will only need to have a helper table with the combination of metric and year and not the actual values of 2025. In the suggestion above, I request using the measure defined and calculating 2025 data in real time which will make it dynamic and get reflected changing based on the slicer selection. Make sure to not include the data into the calculated table. Let me know if you need further clarification or provide sample data for further analysis.
- sharkrocket1 year agoNew Member
Thank you, MohamedFowzan1 . I will try that solution and try to check back in if it works.