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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
stevengaris
Frequent Visitor

If statement not working properly.

I have a measure that is calculating a moving average of deliveries which seems to work fine.   

MovingAVG.PNG

 

I then made a new column with an if statement to compare the daily delivery count against the calculated moving average and mark it either above or below the moving average result. 

abvblw.PNG

 

However, it doesn't seem to be working correctly....  The days 1/7-1/9 are above the average of 12.52 but are saying Below. 

InkedCapture_LI.jpg

1 ACCEPTED SOLUTION
jessegorter
Helper I
Helper I

you created a calculated column right? The row context is not propagated to the filter context, meaning you might compare it with the running average of not only houston...

 

What you can do: create a new calculated column with the measure in it, so you can see what your above / below formula is comparing against.

View solution in original post

4 REPLIES 4
jessegorter
Helper I
Helper I

you created a calculated column right? The row context is not propagated to the filter context, meaning you might compare it with the running average of not only houston...

 

What you can do: create a new calculated column with the measure in it, so you can see what your above / below formula is comparing against.

amitchandak
Super User
Super User

Put it in the table check if it is getting the same values in all rows ?

For dates calculation it is better idea to have date table and use it.

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.

Refer
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

It only says Below for all rows.

 

I have a date table and it is linked in the model view I believe. 

model.PNG

 

This is what it looks like...

dates.PNG

 

How would I incorporate it to help solve this problem? 

Hi @stevengaris ,

 

You may create the "Above/Below" using measure instead of calculated column.

 

Best Regards,

Amy

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.