Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi guys,
Consider the table below.
dimension1 | dimension2 | dimension3 | x | y | z |
abc | grh | juk | 2 | 3 | 1 |
crf | grgr | ukr | 8 | 6 | 2 |
rfg5 | frfrg | hr5 | 9 | 5 | 3 |
I created a parameter which you can select one or multiple metrics (x,y,z)
What i want now if to create a measure which would sum up the values you selected in the parameter.- So if i selected x and y, the measure would be sum(x) + sum(y). Is this possible?
Thanks in advance!
Solved! Go to Solution.
Hi @samerhaidar0811 ,
Please try below steps:
1.below is my test table
Table:
Table2:
create with dax formula
Table 2 = {"x","y","z"}
2. create a measure with below dax formula
Measure =
VAR _str =
IF ( ISFILTERED ( 'Table 2'[Value] ), CONCATENATEX ( 'Table 2', [Value] ) )
VAR sum_x =
SUMX ( ALL ( 'Table' ), [x] )
VAR sum_y =
SUMX ( ALL ( 'Table' ), [y] )
VAR sum_z =
SUMX ( ALL ( 'Table' ), [z] )
VAR _a =
SWITCH (
SELECTEDVALUE ( 'Table 2'[Value] ),
"x", sum_x,
"y", sum_y,
"z", sum_z
)
VAR _b =
SWITCH (
TRUE (),
CONTAINSSTRING ( _str, "xy" ), sum_x + sum_y,
CONTAINSSTRING ( _str, "xz" ), sum_x + sum_z,
CONTAINSSTRING ( _str, "yz" ), sum_y + sum_z
)
RETURN
IF (
LEN ( _str ) = 3,
sum_x + sum_y + sum_z,
SWITCH (
TRUE (),
HASONEVALUE ( 'Table 2'[Value] ), _a,
NOT ( HASONEVALUE ( 'Table 2'[Value] ) ), _b
)
)
4. add a slicer with Table2 and card visual with measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @samerhaidar0811 ,
Please try below steps:
1.below is my test table
Table:
Table2:
create with dax formula
Table 2 = {"x","y","z"}
2. create a measure with below dax formula
Measure =
VAR _str =
IF ( ISFILTERED ( 'Table 2'[Value] ), CONCATENATEX ( 'Table 2', [Value] ) )
VAR sum_x =
SUMX ( ALL ( 'Table' ), [x] )
VAR sum_y =
SUMX ( ALL ( 'Table' ), [y] )
VAR sum_z =
SUMX ( ALL ( 'Table' ), [z] )
VAR _a =
SWITCH (
SELECTEDVALUE ( 'Table 2'[Value] ),
"x", sum_x,
"y", sum_y,
"z", sum_z
)
VAR _b =
SWITCH (
TRUE (),
CONTAINSSTRING ( _str, "xy" ), sum_x + sum_y,
CONTAINSSTRING ( _str, "xz" ), sum_x + sum_z,
CONTAINSSTRING ( _str, "yz" ), sum_y + sum_z
)
RETURN
IF (
LEN ( _str ) = 3,
sum_x + sum_y + sum_z,
SWITCH (
TRUE (),
HASONEVALUE ( 'Table 2'[Value] ), _a,
NOT ( HASONEVALUE ( 'Table 2'[Value] ) ), _b
)
)
4. add a slicer with Table2 and card visual with measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, what if I have not only 3 metrics, but 10? It would require calculating sum for each combination possible... Is there a workaround?
@samerhaidar0811 , try a measure like
if ( "x" in values(table[X]) , Sum(Table[X]) , Blank())
+ if ( "y" in values(table[X]) , Sum(Table[y]) , Blank())
+ if ( "z" in values(table[X]) , Sum(Table[z]) , Blank())
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.