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
charliec
Regular Visitor

Multiple VAR formulas in same measure

Hi there how are you? My name is Carlotta and I am a heavy Power BI user for my work.
I am not sure if this is the right place to address my question, but I will try anyway 😊
I am facing an issue trying to have multiple variables in the same Measure, is it something that is doable at all?var measure.jpg

This is the measure i have but i want to split the result "To Be Confirmed" in 2 other results based on different datails

Is it at all possible?

Thanks in advance for your suggestions!

3 REPLIES 3
harshnathani
Community Champion
Community Champion

HI @charliec ,

 

Shorter version of your code.

 

You cannow use SWITCH()

 

Delivery Status =
VAR DDU = 'F20 SO TO PO'[Delayed Days Updated]
VAR f = 'F20 SO TO PO'[EPO Status]
VAR r = 'F20 SO TO PO'[ReservationStatus]
RETURN
    SWITCH (
        TRUE (),
        f = "Shortage", "Shortage/Released",
        f = "To Be Confirmed", "To Be Confirmed",
        r = "Reserved Physical", "0. In BKM",
        DDU > 30, "5. Very Late (30+)",
        DDU > 14
            && DDU <= 30, "4, Late (15-30)",
        DDU > 7
            && DDU <= 14, "3, Late (8-14)",
        DDU > 0
            && DDU <= 7, "2. Late (1-7)",
        DDU <= 0, "1. On Time",
        "Error"
    )

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

 

amitchandak
Super User
Super User

@charliec , use switch true

Shipment Category =
switch( true(),
'Shipped'[order sum ] <= 40000,"Quick Ship",
'Shipped'[order sum ] < 100000,"10 Day",
"30 Day"
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
AntrikshSharma
Super User
Super User

You can have as many variables you want, also you should use SWITCH instead of IF

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.