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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
RKCD
New Member

Blank values for LY measure

I'm attempting to populate the "Units LY" field in the table below:

 

RKCD_1-1642447279665.png

 

As you can see, I've successfully added my "Units" measure (directly from my source).  The "Month" column is from my Date table and directly references the id column from that table.  The Units YoY% measure returns accurate results and is calculated as: 

 

Units YoY% =
VAR __PREV_YEAR = CALCULATE(SUM('Next Gen Data V3'[Units]), DATEADD('Date'[Month], -1, YEAR))
RETURN
    DIVIDE(SUM('Next Gen Data V3'[Units]) - __PREV_YEAR, __PREV_YEAR)

 

I wanted to include a "Units LY" measure to show the previous year's units for each month, so I added a new measure:

 

Units LY =
CALCULATE(
SUM('Next Gen Data V3'[Units]),
DATEADD('Date'[Month], -1, YEAR)
)

 

However, when I include this new "Units LY" measure in my table, you can see the values are blank. 

 

What's interesting is that my formula for "Units LY" is the exact same formula used to calculate "_PREV_YEAR" in my YoY% formula - where it appears to work correctly within the broader calculation.  So I'm really confused why the underlying "Units LY" calculation wouldn't work as-is. 

 

I've tried re-working the formula using SAMEPERIODLASTYEAR() but the results are the same.  As you can see in the table, I also broke out the DATEADD() function as a separate measure to make sure it was actually recognizing the date from one year earlier - and you can see it works just fine.  

 

Any idea why my "Units LY" measure isnt' returning values?  

 

The dataset is large but I can provide more detail if necessary - thank you!

 

EDIT - for reference - this is my date table:

 

RKCD_0-1642447818367.png

 

And my data structure:

 

RKCD_0-1642447901647.png

 

 

 

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@RKCD looks like you are adding UNITS LY as a column, not a measure, it should be  measure.

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@RKCD not it is not, the measure will look like a calculator.

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@RKCD based on what I see in the menu (column tootls) it is not a measure. try again, make sure to add a measure not a column and that's the only reason why it is not working.

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k - nevermind - I figured it out based on your comment.  Simple fix but it was frustrating me all afternoon - thanks for your help!

Thanks @parry2k. Here it is in the Fields list - based on the icon I believe it already is a measure?

 

RKCD_0-1642454430217.png

 

RKCD
New Member

Thank you for the reply @parry2k 

 

I click "New measure" and input the following:

 

RKCD_0-1642453144434.png

 

Is there something I should be doing differently to create it as a measure?  

 

(Sorry if I'm missing something obvious - just started teaching myself)

parry2k
Super User
Super User

@RKCD looks like you are adding UNITS LY as a column, not a measure, it should be  measure.

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.