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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
StrollnDataLand
New Member

Display last 5 weeks based on Selected Date

Hi everyone,

 

I am pretty new to Power Bi and DAX, so I'd appreciate any pointers here.

 

Here is my problem:

Based on the selected date, I need to display data in a matrix table on the selected date and 5 weeks ago. Unfortunately, this is a problem from work, so I'm unable to share the actual data but here is an example with some dummy data:

 

My selected date is 9/15/23. This is the data that should be displayed:

Screenshot 2023-09-21 at 10.19.48 PM.png

 

If I select the date to be 9/8/23, this is how the new selected data should be displayed:

Screenshot 2023-09-21 at 10.25.09 PM.png

In essence, selecting 9/8/23 results in the 9/8/23 totals to be added to the 9/15/23 totals. The remaining data results would display weekly from 8/11/23 up to 9/1/23. This type of functionality should exist for any selected date I choose.

 

Here is a dummy view of what my actual table looks like. I also have a independent date table that is the distinct updated date from my actual table.

Updated DateDays OpenStatusCountDate Difference  (Today - Updated Date)
9/15/230 to 9A3

6

9/15/2310 to 19A136
9/15/230 to 9B56
9/15/2310 to 19B106
9/8/230 to 9A513
9/8/2310 to 19A313
9/8/230 to 9B613
9/8/2310 to 19B513

 

 

Currently, I have a display similar to the 1st picture, but this is without selecting any dates. I calculated a date difference between the updated date and Today's date and used those numbers as a filter to help display something similar to the first picture.

 

Now if I try to select a date using a filter, it will only display that selected date's data, which isn't what I want. I tried to utilize the independent date table in the filter but obviously was running into issues because there's no actual relationship between my actual table and the date table. And even if I'm able to figure out this issue, I'm not even sure how I can visualize the second picture.

 

Is this type of visualization even possible in Power BI? I just don't know where to begin 😞

1 REPLY 1
lbendlin
Super User
Super User

 I also have a independent date table that is the distinct updated date from my actual table.

Date tables need to be contiguous and covering.  Your fact data is not a good source for that.

 

Your sample data barely covers a week.  Please provide sample data that fully covers your question (five weeks plus, in your case)

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors