cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
a1b1c1
Advocate I
Advocate I

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. 


Thanks for your help in advance.
@MFelix @mahoneypat @parry2k @amitchandak 
1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

@a1b1c1 

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
a1b1c1
Advocate I
Advocate I

@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. 🙂

PhilipTreacy
Super User
Super User

@a1b1c1 

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors