Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Solved! Go to Solution.
Hi All,
Firstly bhanu_gautam thank you for your solution!
And @unknown917 , I tried to simplify your code a bit, not so much conditional judgment , to reduce your code redundancy, to see if it can solve your problem!
Max Possible Hits(column) =
VAR _CalcSingle =
SWITCH(
TRUE(),
'Table'[1 stp threshold] <= 19, 13,
'Table'[1 stp threshold] <= 38, 26,
'Table'[1 stp threshold] <= 77, 52,
'Table'[1 stp threshold] <= 129, 104,
'Table'[1 stp threshold] <= 181, 156,
'Table'[1 stp threshold] <= 233, 208,
'Table'[1 stp threshold] <= 285, 260,
'Table'[1 stp threshold] <= 337, 312,
'Table'[1 stp threshold] <= 4569, 364
)
VAR _CalcMulti =
SWITCH(
TRUE(),
'Table'[>1 stp/wk threshold] <= 19, 13,
'Table'[>1 stp/wk threshold] <= 38, 26,
'Table'[>1 stp/wk threshold] <= 77, 52,
'Table'[>1 stp/wk threshold] <= 129, 104,
'Table'[>1 stp/wk threshold] <= 181, 156,
'Table'[>1 stp/wk threshold] <= 233, 208,
'Table'[>1 stp/wk threshold] <= 285, 260,
'Table'[>1 stp/wk threshold] <= 337, 312,
'Table'[>1 stp/wk threshold] <= 4569, 364
)
RETURN
IF(
'Table'[1 stp threshold]< 52,
_CalcSingle,
IF('Table'[>1 stp/wk threshold]<52,
52,
_CalcMulti))
If you have further questions, you can contact me at any time, I will reply to you as soon as I receive your message, I look forward to hearing from you!
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi All,
Firstly bhanu_gautam thank you for your solution!
And @unknown917 , I tried to simplify your code a bit, not so much conditional judgment , to reduce your code redundancy, to see if it can solve your problem!
Max Possible Hits(column) =
VAR _CalcSingle =
SWITCH(
TRUE(),
'Table'[1 stp threshold] <= 19, 13,
'Table'[1 stp threshold] <= 38, 26,
'Table'[1 stp threshold] <= 77, 52,
'Table'[1 stp threshold] <= 129, 104,
'Table'[1 stp threshold] <= 181, 156,
'Table'[1 stp threshold] <= 233, 208,
'Table'[1 stp threshold] <= 285, 260,
'Table'[1 stp threshold] <= 337, 312,
'Table'[1 stp threshold] <= 4569, 364
)
VAR _CalcMulti =
SWITCH(
TRUE(),
'Table'[>1 stp/wk threshold] <= 19, 13,
'Table'[>1 stp/wk threshold] <= 38, 26,
'Table'[>1 stp/wk threshold] <= 77, 52,
'Table'[>1 stp/wk threshold] <= 129, 104,
'Table'[>1 stp/wk threshold] <= 181, 156,
'Table'[>1 stp/wk threshold] <= 233, 208,
'Table'[>1 stp/wk threshold] <= 285, 260,
'Table'[>1 stp/wk threshold] <= 337, 312,
'Table'[>1 stp/wk threshold] <= 4569, 364
)
RETURN
IF(
'Table'[1 stp threshold]< 52,
_CalcSingle,
IF('Table'[>1 stp/wk threshold]<52,
52,
_CalcMulti))
If you have further questions, you can contact me at any time, I will reply to you as soon as I receive your message, I look forward to hearing from you!
Hope it helps!
Best regards,
Community Support Team_ Tom Shen
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
makes sense! thank you!!
@unknown917 , Try using
Max Possible Hits =
VAR Thresholds =
{
(0, 19, 13),
(20, 38, 26),
(39, 77, 52),
(78, 129, 104),
(130, 181, 156),
(182, 233, 208),
(234, 285, 260),
(286, 337, 312),
(338, 4569, 364)
}
VAR GetMaxHits =
VAR CurrentThreshold = 'Table'[1 stp threshold]
RETURN
MAXX(
FILTER(
Thresholds,
CurrentThreshold >= [Value1] && CurrentThreshold <= [Value2]
),
[Value3]
)
VAR GetMaxHitsMulti =
VAR CurrentThresholdMulti = 'Table'[>1 stp/wk threshold]
RETURN
MAXX(
FILTER(
Thresholds,
CurrentThresholdMulti >= [Value1] && CurrentThresholdMulti <= [Value2]
),
[Value3]
)
RETURN
IF(
GetMaxHits < 52,
GetMaxHits,
IF(
GetMaxHitsMulti < 52,
52,
GetMaxHitsMulti
)
)
Proud to be a Super User! |
|
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 12 | |
| 10 | |
| 8 |