Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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! |
|
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |