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
Hi guys,
i have a model like this
I create 6 separate measures for each Login, Value, Quant
But i dont know how can I group them together to compare Target and Actual categories, like in the chart and table shown below?
I don’t want to change anything in the fact or dimension tables. Do we have a way to work on this kind of chart? Any help is appreciated.
Thank you in advance!
Solved! Go to Solution.
Hi @SamVH12
Can you please follow the below steps to get your result.
1. Create a table using below dax.
Hi @SamVH12
Can you please follow the below steps to get your result.
1. Create a table using below dax.
Yay, it works well for me! Many thanks for your help! 🤗
Create a calculated field called KPI Group
CASE [Measure Names]
WHEN 'Login_Actual' THEN 'Login'
WHEN 'Login_Target' THEN 'Login'
WHEN 'Value_Actual' THEN 'Value'
WHEN 'Value_Target' THEN 'Value'
WHEN 'Quant_Actual' THEN 'Quant'
WHEN 'Quant_Target' THEN 'Quant'
END
Create another calculated field called Actual/Target Category
CASE [Measure Names]
WHEN 'Login_Actual' THEN 'Actual'
WHEN 'Login_Target' THEN 'Target'
WHEN 'Value_Actual' THEN 'Actual'
WHEN 'Value_Target' THEN 'Target'
WHEN 'Quant_Actual' THEN 'Actual'
WHEN 'Quant_Target' THEN 'Target'
END
Then in the visual :
Thank you for your help. I'm not sure I understand the 'calculated field', does it refer to calculated columns? If so, the 6 measures (Value, Quant, Login for both target and actual) are in 4 different tables. How can we create calculated columns using all six of them?
Hi @SamVH12 ,
You can definitely do this without changing your fact or dimension tables. The key is to reshape your measures into a unified format using a disconnected table and SWITCH() logic.
Here’s how:
MeasureType = DATATABLE("Type", STRING, {{"Actual Login"}, {"Actual Value"}, {"Actual Quant"}, {"Target Login"}, {"Target Value"}, {"Target Quant"}}) SelectedMeasure =
SWITCH(
SELECTEDVALUE(MeasureType[Type]),
"Actual Login", [Actual Login],
"Actual Value", [Actual Value],
"Actual Quant", [Actual Quant],
"Target Login", [Target Login],
"Target Value", [Target Value],
"Target Quant", [Target Quant]
)This approach keeps your model clean and gives you full flexibility in visuals.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
Thank you, but this will still display 6 measures separately, each with a different label, rather than grouping them by Value, Quant, or Login, and compares them based on actual & target values, which doesn't align with my requirements
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 |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 71 | |
| 66 | |
| 33 | |
| 32 | |
| 32 |