The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi, i have the code below and was wondering how to have it so if "all" were selected on the filter it would show another value?
Really stuck on this one.
Calc Rework Target =
SWITCH( TRUE(),
"A P" in allselected('Index_Part Information'[Additional_Field_2]) , 1000 ,
"AP Jet" in allselected('Index_Part Information'[Additional_Field_2]) , 150 ,
"SSO" in allselected('Index_Part Information'[Additional_Field_2]) , 500 ,
"LMT" in allselected('Index_Part Information'[Additional_Field_2]) , 500 )
Solved! Go to Solution.
Hi @Jackbaz99 ,
You may try this Measure.
Rework Target =
VAR Table_ =
ADDCOLUMNS (
'Index_Part Information',
"Target",
SWITCH (
TRUE (),
"A P" IN ALLSELECTED ( 'Index_Part Information'[Additional_Field] ), 1000,
"AP Jet" IN ALLSELECTED ( 'Index_Part Information'[Additional_Field] ), 150,
"SSO" IN ALLSELECTED ( 'Index_Part Information'[Additional_Field] ), 500,
"LMT" IN ALLSELECTED ( 'Index_Part Information'[Additional_Field] ), 500,
ISBLANK ( SELECTEDVALUE ( 'Index_Part Information'[Additional_Field] ) ), 0
)
)
RETURN
SUMX ( Table_, [Target] )
Then, the result will look like this.
Also, attached the pbix file as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Hi @Jackbaz99 ,
You may try this Measure.
Rework Target =
VAR Table_ =
ADDCOLUMNS (
'Index_Part Information',
"Target",
SWITCH (
TRUE (),
"A P" IN ALLSELECTED ( 'Index_Part Information'[Additional_Field] ), 1000,
"AP Jet" IN ALLSELECTED ( 'Index_Part Information'[Additional_Field] ), 150,
"SSO" IN ALLSELECTED ( 'Index_Part Information'[Additional_Field] ), 500,
"LMT" IN ALLSELECTED ( 'Index_Part Information'[Additional_Field] ), 500,
ISBLANK ( SELECTEDVALUE ( 'Index_Part Information'[Additional_Field] ) ), 0
)
)
RETURN
SUMX ( Table_, [Target] )
Then, the result will look like this.
Also, attached the pbix file as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
@Jackbaz99 Maybe:
Calc Rework Target =
SWITCH( TRUE(),
COUNTROWS('Index_Part Information') = COUNTROWS(ALL('Index_Part Information')), 999,
"A P" in allselected('Index_Part Information'[Additional_Field_2]) , 1000 ,
"AP Jet" in allselected('Index_Part Information'[Additional_Field_2]) , 150 ,
"SSO" in allselected('Index_Part Information'[Additional_Field_2]) , 500 ,
"LMT" in allselected('Index_Part Information'[Additional_Field_2]) , 500 )
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |