The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Apps | Year | Period | Availability (calculated col) |
App2 | 2020 | P2 | 99.98% |
App1 | 2020 | P1 | 90.10% |
App1 | 2020 | P2 | 90.84% |
App2 | 2020 | P3 | 99.80% |
App3 | 2020 | P1 | 99.45% |
Apps | Period_1 | Period_2 | Period_3 |
App1 | 99.10% | 90.84% | 99.99% |
App2 | 99.99% | 99.98% | 99.98% |
App3 | 99.45% | 99.95% | 99.95% |
App4 | 99.9% | 99.9% | 99.9% |
Solved! Go to Solution.
Hi @meyerliu ,
Try like these measures:
Period_1 =
VAR _Average =
CALCULATE (
AVERAGE ( 'Data'[Availablity] ),
FILTER ( 'Data', 'Data'[Year] = 2020 && 'Data'[Period] = "P1" )
) * 100
RETURN
IF (
_Average <> BLANK (),
_Average & "%",
IF ( SELECTEDVALUE ( Data[Apps] ) = "App2", "99.99%", "99.9%" )
)
Period_2 =
VAR _Average =
CALCULATE (
AVERAGE ( 'Data'[Availablity] ),
FILTER ( 'Data', 'Data'[Year] = 2020 && 'Data'[Period] = "P2" )
) * 100
RETURN
IF (
_Average <> BLANK (),
_Average & "%",
IF ( SELECTEDVALUE ( Data[Apps] ) = "App3", "99.95%", "99.9%" )
)
Period_3 =
VAR _Average =
CALCULATE (
AVERAGE ( 'Data'[Availablity] ),
FILTER ( 'Data', 'Data'[Year] = 2020 && 'Data'[Period] = "P3" )
) * 100
RETURN
IF (
_Average <> BLANK (),
_Average & "%",
IF (
SELECTEDVALUE ( Data[Apps] ) = "App1",
"99.99%",
IF ( SELECTEDVALUE ( Data[Apps] ) = "App3", "99.95%", "99.9%" )
)
)
Sample file is attached that hopes to help you, please check and try it: Measure with condition for multiple blanks in column.pbix
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi @meyerliu ,
Try like these measures:
Period_1 =
VAR _Average =
CALCULATE (
AVERAGE ( 'Data'[Availablity] ),
FILTER ( 'Data', 'Data'[Year] = 2020 && 'Data'[Period] = "P1" )
) * 100
RETURN
IF (
_Average <> BLANK (),
_Average & "%",
IF ( SELECTEDVALUE ( Data[Apps] ) = "App2", "99.99%", "99.9%" )
)
Period_2 =
VAR _Average =
CALCULATE (
AVERAGE ( 'Data'[Availablity] ),
FILTER ( 'Data', 'Data'[Year] = 2020 && 'Data'[Period] = "P2" )
) * 100
RETURN
IF (
_Average <> BLANK (),
_Average & "%",
IF ( SELECTEDVALUE ( Data[Apps] ) = "App3", "99.95%", "99.9%" )
)
Period_3 =
VAR _Average =
CALCULATE (
AVERAGE ( 'Data'[Availablity] ),
FILTER ( 'Data', 'Data'[Year] = 2020 && 'Data'[Period] = "P3" )
) * 100
RETURN
IF (
_Average <> BLANK (),
_Average & "%",
IF (
SELECTEDVALUE ( Data[Apps] ) = "App1",
"99.99%",
IF ( SELECTEDVALUE ( Data[Apps] ) = "App3", "99.95%", "99.9%" )
)
)
Sample file is attached that hopes to help you, please check and try it: Measure with condition for multiple blanks in column.pbix
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.