cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
GSinghking Regular Visitor
Regular Visitor

Simple IF STATEMENT asap


Hi,

Real quick one here. I have a Measure, that calcualtes what you see under here. Some on the values are blank. I want to aadd in a if statement.


TEST A =

help here: IF VALUE OF THIS MEASURE IS BLANK, RETURN (ANOTHER MEASURE) ELSE IF, USE THE MEASURE UNDER HERE.

CALCULATE (
    MAX ( 'DATASET A'[Volume p1] ),
    FILTER ( 'DATESET A', 'DATA SET A'[Dato/tid] = [Max date/time] ) 
Capture.PNGWant to add measure of the left in measure test a, where its blank. So the output becomes 0. like 19.85 - 19.85. So want a if statment here. If test a is blank return, measure on the left. Which gives the en result 0
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Simple IF STATEMENT asap

Hi @GSinghking ,

 

Maybe you can try to use the measure if it works on your side:

Test =
IF (
    [Measure1] <> BLANK (),
    [Measure1],
    CALCULATE (
        MAX ( 'DATASET A'[Volume p1] ),
        FILTER ( ALLSELECTED ( 'DATESET A' ), 'DATA SET A'[Dato/tid] = [Max date/time] )
    )
)

If above not help, please share some sample data so that we can test to coding formula on it.

 

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |
1 REPLY 1
Community Support Team
Community Support Team

Re: Simple IF STATEMENT asap

Hi @GSinghking ,

 

Maybe you can try to use the measure if it works on your side:

Test =
IF (
    [Measure1] <> BLANK (),
    [Measure1],
    CALCULATE (
        MAX ( 'DATASET A'[Volume p1] ),
        FILTER ( ALLSELECTED ( 'DATESET A' ), 'DATA SET A'[Dato/tid] = [Max date/time] )
    )
)

If above not help, please share some sample data so that we can test to coding formula on it.

 

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |