Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jloper
Regular Visitor

If Statement question

Hello,

 

I'm trying to write the following if statement to return a specif text logic in the "Budget Action" measure.  I am currently using Switch/True and running into issues with how long it is taking to refresh and hoping there may be a more efficient way to write what I'm looking to do.  (Projects vs Gantt and PRJ vs Gantt % are measures aleady in the table)

 

IF

Projects vs Gantt <-100, "Write off Needed"

Projects vs Gantt % <-.1, "Write off Needed"

Projects vs Gantt <0, "Review Needed"

Projects vs GAntt % >=.1, "Potential Budget Reduction"

Else

On Track

 

Thanks in advance

 

Budget Action Table.JPG

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@jloper 

Can you try it this way, Also, check your data model for possible optimizations:

 

Measure = 
var __gantt = [Projects vs Gantt]
var __gantt_pct = [Projects vs Gantt &]
return

SWITCH( 
    TRUE(),
    __gantt_pct >= 0.1, "Potential Budget Reduction",
    __gantt <-100 || __gantt_pct <- 0.1, "Write off Needed",
    __gantt < 0, "Review Needed",
    "On Track"
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

1 REPLY 1
Fowmy
Super User
Super User

@jloper 

Can you try it this way, Also, check your data model for possible optimizations:

 

Measure = 
var __gantt = [Projects vs Gantt]
var __gantt_pct = [Projects vs Gantt &]
return

SWITCH( 
    TRUE(),
    __gantt_pct >= 0.1, "Potential Budget Reduction",
    __gantt <-100 || __gantt_pct <- 0.1, "Write off Needed",
    __gantt < 0, "Review Needed",
    "On Track"
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.