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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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] ) 
Want 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 0Want 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
Anonymous
Not applicable

Hi @Anonymous ,

 

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.