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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gulrog
New Member

Filter all records from yesterday in power bi web

How can I create a filter, so that I only see records from yesterday? I have a dataset with a date field, but I can not understand how to write a filter that will list all records from yesterday. I have searched the net for this, but all answers are talking about DAX, but as far as I undertand DAX is not available in power bi for web - only desktop, so how can I do this?

5 REPLIES 5
kcantor
Community Champion
Community Champion

@gulrog

Quick down and dirty filter with dates:

Make sure you have a date table and it is related to fact table. Date table should contain year, month, day of month, and datekey (List of all dates with no missing dates).

Add a slicer for year. Select current year in filter.

Add a slicer for month. Select current month in filter.

Add a slicer for day of month. Select yesterday.

This method should require no DAX. However, why not download desktop and code a little DAX in. It would be very useful for further filter/calculations.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks! I'm not sure if I understand. I have created the dataset using the rest api, and I'm populating this dataset using the API. Is it possible for me to create a date table and relate it to the other table then? Is so, can you point me to any documention on how to do that?

 

I can download the desktop version (in fact I have), but again, will I be able to code DAX when I'm using the REST API to populate the dataset?

kcantor
Community Champion
Community Champion

My apologies. I did not see where you were using REST API. I am not familiar with that process.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@gulrog If i understood correct you're using power bi REST APIs to create dataset programatically. I think REST APIs only has two Dataset operations create and get (to create dataset and get to push data into it from other apps). You won't be able to do DAX / data modelling tasks that you can do in power bi desktop.

 

You can avoid using power bi desktop by using filtering in power bi service but that filtering won't be dynamic so everyday you have to update the date manually to show data for yesterday.

 

Other option is to use power bi desktop and use DAX there. I would suggest you continue using REST API method (if you absolutely need that) and sort your visuals by date field so you're seeing todays date followed by yesterday. Not exactly what you want but somewhat closer. 

OK. I start to undertand that the REST API is not ready for prime time yet. It's a shame, because it was a very easy way to push data into power bi. I will start looking into another way of populating power bi with data.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors