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
Black_magic100
Helper III
Helper III

How do you select the value of yesterday

I have literally been trying to figure this out for the past 4 hours.  I have tried using variables, Previousday, intervals, etc.  

 

No matter what I do I literally can not seem to select a single cell from yesterday's date.  I need to create a measure beacuse I have to use that number to do further calculations.  It should not be this difficult =[

 

I have a table that already aggregates total users and updates daily.  Just need a measure to select this value. I have a date table.

27 REPLIES 27

So I just realized that in Edit Query mode it is actually perfect, but in the modeling view that I showed you it seems to be skipping dates.  When I hit the filter on "date" column in modeling mode I can see every single day in order so it is definitely a sort by column issue.  Is that bad?  

Nope, the way you have the table sorted in the data view won't do anything to calculations using the table.

CALCULATE(SUM('LogTable'[RunStatus]),'LogTable'[Date]=Date(YEAR(now()),Month(now()),(DAY(now())-1)))

 

If I used my date table here why would that not work than?  Isn't it just saying the same thing as using the tables date?  I don't get it

CALCULATE(SUM('LogTable'[RunStatus]),'LogTable'[Date]=Date(YEAR(now()),Month(now()),(DAY(now())-1)))

 

--This part sums your values

CALCULATE(SUM('LogTable'[RunStatus]),

 

--This part checks for your dates in the table. Should also work with date table. Perhaps if you try using Related() 

'LogTable'[Date]=

 

--This part sets yesterdays date.

Date(YEAR(now()),Month(now()),(DAY(now())-1)))

 

Hope that helps.

I noticed that as well, but it is because I organize by MonthNum.  If I don't do that the numbers are messed up on a line graph.  I don't think that is the issue?  The order of the column itself should not matter if all the dates are there and they are organized accordingly?  That is just how the data is stored?

Could you post your Measure?

No just returns blank... Let me see if I can't just create an imgur album and add a ton of pictures of my data

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.