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
giroldoale
Helper I
Helper I

Variable not allowed

Hi,

I'm pretty new into DAX formulas.

I'd like to know the reason why in the formula reported into the screendshot there is no possibility to inser the variables of the table.

I need to write a formula like this--> If(Ship Date<>Blank(), 1,0) -->why it is not allow to me?

giroldoale_0-1618908291141.png

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @giroldoale ,

 

In the measure, if you want to get the row value you will need to use SELECTEDVALUE() function.

So your measure should be like:

IF(SELECTEDVALUE(skip date)<>blank(),1,0)

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @giroldoale ,

 

In the measure, if you want to get the row value you will need to use SELECTEDVALUE() function.

So your measure should be like:

IF(SELECTEDVALUE(skip date)<>blank(),1,0)

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
HarishKM
Impactful Individual
Impactful Individual

@giroldoale  Hey Mate ,
While using if you have provide some aggregation(max (date[date]) or min(date[date]) then only you are allowed else use power query .

Kindly open power query then go to add col. then select conditona col and follow below method it will fulfil your requirment .

HarishKM_1-1618911381914.png


output will be when date then 1 else 0 .
output will be like this 

HarishKM_3-1618911494160.png

 

Kudos will be appriciated .

 

 

 

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.