The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi guys! Can anyone answer a question about power bi?
I have a table with a date column. I need to solve a problem as follows:
1- A filter must be created to select the date.
2- The dashboard should filter the table with the value of that date and with the value of the previous day.
- In other words:
- If the user has selected the day 30-08-2024, it should show the data referring to the day 30-08-2024 and 29-08-2024
This column with the two dates will be used to filter another table based on the data collected.
I don't know how to do this, so if someone could help, that would be great!
Translated with DeepL.com (free version)
Solved! Go to Solution.
Hey @gpuc09_ ,
No worries! I’ve put together a DAX measure that calculates and displays the values for both the selected date and the previous date. Take a look at the attached image and file to see how it works. Hope it helps!
Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI
Hello @marcelsmaglhaes!
Thanks for your help, but it's not exactly what I wanted... Let me see if I can be more specific and send you a draft of the dashboard!
Suppose I have this data (Image 01), where I have several values for the dates from October 1st to October 10th. When I create a filter, with a single selection, of the dates present in my column (Image 02), I need the table to show the values of that selected date and the previous day, in separate rows (Image 03).
I think it's clearer this way! If you can edit the draft to get the result, that would be great!
Thank you very much!
Dataset values:
Hey @gpuc09_ ,
No worries! I’ve put together a DAX measure that calculates and displays the values for both the selected date and the previous date. Take a look at the attached image and file to see how it works. Hope it helps!
Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI
Hey @gpuc09_
To achieve this in Power BI, you can create a measure that dynamically selects both the chosen date and the previous day. See the example below. The approach uses the var selecteddate and pday (previous day's date)
to adjust the data context accordingly
Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI