Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
I attempted multiple measures to get the results i need. I can do either SUM or AVERAGE but not both. Where am i going wrong?
Solved! Go to Solution.
Hi @ybicalways79
Please try
FormatMetric OperationalSales =
VAR Val =
SUM ( SalesData[Value] )
VAR Ave =
AVERAGE ( SalesData[Value] )
RETURN
SWITCH (
SELECTEDVALUE ( SalesData[Attribute] ),
"Overall Sales", FORMAT ( Val, "$#,##0;($#,##0)" ),
"Overall Conversion (%)", FORMAT ( Ave, "0.0%" ),
"Overall Margin (%)", FORMAT ( Ave, "0.0%" ),
"Overall Lookup (Ct.)", FORMAT ( Val, "0" )
)
Hi @ybicalways79
Please try
FormatMetric OperationalSales =
VAR Val =
SUM ( SalesData[Value] )
VAR Ave =
AVERAGE ( SalesData[Value] )
RETURN
SWITCH (
SELECTEDVALUE ( SalesData[Attribute] ),
"Overall Sales", FORMAT ( Val, "$#,##0;($#,##0)" ),
"Overall Conversion (%)", FORMAT ( Ave, "0.0%" ),
"Overall Margin (%)", FORMAT ( Ave, "0.0%" ),
"Overall Lookup (Ct.)", FORMAT ( Val, "0" )
)
Thank you! I was so close on this one!
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.