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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I was trying to satisfy a requirement based on these parameters
Count of Transactions
less than 24 Hrs,
More than 72 Hrs and
More than 120 Hours
I created a calculated column Hours Difference by using datediff
and create a tagging
Which returns like
My problem with this requirement is there is a gap there are some transactions that occur 25+ hours up to 71 hours.
which is not covered in the requirement that was given.
Any chance of Specifying those in the actual measure? I was hoping to see those 120+ as well
Workarounds are highly appreciated. TIA!
Solved! Go to Solution.
Hi @v_mark ,
try this
SLAs = SWITCH(TRUE(),
'Sample Data'[Hours] <= 24 , " Less than 24 Hrs ",
'Sample Data'[Hours] >= 120, " More Than 120 Hrs",
'Sample Data'[Hours] >= 72 , " More Than 72 Hrs ",
'Sample Data'[Hours] >= 25 , " More Than 25 Hrs ",
BLANK())
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Hi @v_mark ,
Here are the steps you can follow:
1. Create calculated column.
SLAs =
SWITCH(TRUE(),
'Sample Data'[Hours] <= 24 ," Less than 24 Hrs ",
'Sample Data'[Hours] >= 72&&'Sample Data'[Hours]<120 ," More Than 72 Hrs ",
'Sample Data'[Hours] >= 120," More Than 120 Hrs",
BLANK())
2. If you don’t want to display blank data, you can turn off "Show items with no data".
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @v_mark ,
try this
SLAs = SWITCH(TRUE(),
'Sample Data'[Hours] <= 24 , " Less than 24 Hrs ",
'Sample Data'[Hours] >= 120, " More Than 120 Hrs",
'Sample Data'[Hours] >= 72 , " More Than 72 Hrs ",
'Sample Data'[Hours] >= 25 , " More Than 25 Hrs ",
BLANK())
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials