Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi all,
I got the following dax code:
Hi @MarcoW91,
You can add a variable to store the selection items, then you can add if statements in your expression to achieve parameterized calculations:
Future Forecast =
VAR selection =
VALUES ( DIM_SPGHierarchy[SPG] )
RETURN
SUMX (
'FC UnderRev',
'FC UnderRev'[COS URev_FC]
* (
1
+ IF ( "WirePercentage" IN selection, [WirePercentage] )
+ IF ( "WireRodPercentage" IN selection, [WireRodPercentage] )
+ IF ( "ProfilePercentage" IN selection, [ProfilePercentage] )
+ IF ( "PowderPercentage" IN selection, [PowderPercentage] )
)
)
Regards,
Xiaoxin Sheng
I want to apply this code only on the selected items from a filter
There's a DAX function for that - FILTERS(). Also read about VALUES() and ISFILTERED().
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.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!