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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

MEasure

Hi Guys,

 

i've created the below formula and it is working for only condition Unit = THM and not for Unit = DTH.

 

Does the formula picks only 1 condition at a time?

 

Annual Usage (DTH) = IF (
[typename] = "Nat Gas" && [Unit] = "THM" && [Unit] = "DTH",
ROUND ( [AnnualUsage] / 10.0, 0 )+0)+0

 

Himanshu_13_0-1609756603692.png

 

Regards,

Himanshu

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Use || or In

 

Annual Usage (DTH) = IF (
[typename] = "Nat Gas" && [Unit] = "THM" || [Unit] = "DTH",
ROUND ( [AnnualUsage] / 10.0, 0 )+0)+0, 0)

 

 

Annual Usage (DTH) = IF (
[typename] = "Nat Gas" && [Unit] in{ "THM" , "DTH" },
ROUND ( [AnnualUsage] / 10.0, 0 )+0)+0 ,0)

 

added else part, change as per need

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

View solution in original post

AlB
Community Champion
Community Champion

Hi @Anonymous 

Annual Usage (DTH) =
IF (
    [typename] = "Nat Gas" && [Unit] IN { "THM", "DTH" },
    ROUND ( [AnnualUsage] / 10.0, 0 )
) + 0

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

View solution in original post

3 REPLIES 3
AlB
Community Champion
Community Champion

Hi @Anonymous 

Annual Usage (DTH) =
IF (
    [typename] = "Nat Gas" && [Unit] IN { "THM", "DTH" },
    ROUND ( [AnnualUsage] / 10.0, 0 )
) + 0

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

amitchandak
Super User
Super User

@Anonymous , Use || or In

 

Annual Usage (DTH) = IF (
[typename] = "Nat Gas" && [Unit] = "THM" || [Unit] = "DTH",
ROUND ( [AnnualUsage] / 10.0, 0 )+0)+0, 0)

 

 

Annual Usage (DTH) = IF (
[typename] = "Nat Gas" && [Unit] in{ "THM" , "DTH" },
ROUND ( [AnnualUsage] / 10.0, 0 )+0)+0 ,0)

 

added else part, change as per need

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
Anonymous
Not applicable

Thanks Amit for the help as usual 🙂

 

Regards,

Himanshu

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.