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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
OsmanEmi
Frequent Visitor

Variable Usage - (VAR)

Hi,

I'm trying to understand variable usage and tried creating the mesaure below however, when put into a table the result is true/false as opposed to value.

Please can you explain where i'm going wrong and if my logic is flawed.

Measure is below the Target% measure is a %


Scoring System =
var CurrentScore = 0
Return IF(Target[Target%] > 0.98, CurrentScore = CurrentScore + 0, CurrentScore = CurrentScore + 1)
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@OsmanEmi , this can be like

 

Scoring System =
var CurrentScore = 0
Return IF(Target[Target%] > 0.98,  CurrentScore + 0,  CurrentScore + 1)

 

but are you expecting looping that will not happen 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@OsmanEmi , this can be like

 

Scoring System =
var CurrentScore = 0
Return IF(Target[Target%] > 0.98,  CurrentScore + 0,  CurrentScore + 1)

 

but are you expecting looping that will not happen 

Hi Amit,

Thank you this was what I was looking for.
In terms of if I wanted to create a nested if that adds more to the variable would this still work?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors