cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

## Equal to comparison between two measures

I know that it sounds like a beginner level problem, but being a seasoned Power BI guy I've ran into a quite weird scenario that upon comparing two measures, the equal to comparison is not working correctly.

Here's the DAX:

IF([Total Activities]=[Yearly Average of Activities],2)
Context: I see that when these two values are infact equal, it does not return 2.

@MFelix @mahoneypat @parry2k @amitchandak
1 ACCEPTED SOLUTION
Super User

Please supply some data to test and examples of when this does not work.

How are you calculating the 2 measures [Total Activities] and [Yearly Average of Activities] ?

What data types are these measures?  By their naming I'd expect [Total Activities] to be Whole Number and  [Yearly Average of Activities] to be a Decimal?

If so, could it be that the decimal is formatted to look like a whole number, thereby giving the impression that both measures are equal at times?

Regards

Phil

If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!

2 REPLIES 2

@PhilipTreacy I found out partially it was due to formatting (decimal formatted as whole number), topped up with some filter context issues which I took care of.
Cheers mate. 🙂

Super User

Please supply some data to test and examples of when this does not work.

How are you calculating the 2 measures [Total Activities] and [Yearly Average of Activities] ?

What data types are these measures?  By their naming I'd expect [Total Activities] to be Whole Number and  [Yearly Average of Activities] to be a Decimal?

If so, could it be that the decimal is formatted to look like a whole number, thereby giving the impression that both measures are equal at times?

Regards

Phil

If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors