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.
Hi,
my purpose is filter in my dax query data relative only previuos day.
How can I filter without specify date?
Solved! Go to Solution.
Hello! Ideally, you will have a star schema model and have a date dimension table (here is a link to a blog I wrote about this and it has a link to my favorite date table: http://powerbiwithme.com/2023/08/01/the-custom-date-table-edition/). Once you have your date table set up and joined (and marked as a date table), you can make your initial base measure whether it is a count or sum or whatever on some field of your fact table. Then you can can make a measure for the prior day: Measure PD = CALCULATE([Your Measure], DATEADD('DateTable'[Date],-1,DAY)). Then, if you have your report filtered to today, the PD measure will give you the results for yesterday. If you are filtered to April 20, it will give you April 19.
Proud to be a Super User! | |
Hello! Ideally, you will have a star schema model and have a date dimension table (here is a link to a blog I wrote about this and it has a link to my favorite date table: http://powerbiwithme.com/2023/08/01/the-custom-date-table-edition/). Once you have your date table set up and joined (and marked as a date table), you can make your initial base measure whether it is a count or sum or whatever on some field of your fact table. Then you can can make a measure for the prior day: Measure PD = CALCULATE([Your Measure], DATEADD('DateTable'[Date],-1,DAY)). Then, if you have your report filtered to today, the PD measure will give you the results for yesterday. If you are filtered to April 20, it will give you April 19.
Proud to be a Super User! | |
Hi,
I've check that with this sintax the output of query is always the same and relative to the dates present in the query.
My purpose is query with an output reative measurement of last one day available.
Thank's
could you pls provide some sample data and expected output?
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |