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
ksfx77
Helper I
Helper I

How to lookup date ranges and apply a dynamic filter to my report

Hi all,

 

I need to generate a report on gaming tournament using data in two tables.

 

The first is a session history table showing general gameplay session data (main data table).  The second is a tournaments table which ties the name of a tournament, which the game guid of the game played in the tournament (there is a relationship between the two tables based on this unique value), and the start and end dates of the tournament period.

 

I need to show, amongst other things, unique players in the tournament.

 

I can do this easily statically, but I need to create a drop down selection of the available tournaments, which I can do using a slicer, but I am stuck when it come to fetching the associated date range, and applying that as a filter to my report.

 

Any guidance will be gratefully received.  I am a relative noob, and whilst this sound like a fairly simple ask, I am not sure where to start.

 

Thanks!

6 REPLIES 6
Anonymous
Not applicable

From what it sounds like, It sounds like you need to add a third table, which is simply a table of dates (see below link) - 

https://kohera.be/blog/power-bi/how-to-create-a-date-table-in-power-bi-in-2-simple-steps/

 

Then, simply create a relationship between each table and the date table, similar to below - 

 

Karlos_0-1595589888236.png

 

and it should work. 

Hi @Anonymous  ,

 

Thanks for the response.

 

I am not sure how this will apply a start and end date range to the original query?

 

Maybe I am missing something?

 

Thanks

Hi @ksfx77 ,

 

I may be missing something.

 

What do you want to show in the slicers ?

 

1.jpg

 

 

Regards,
Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

Hi @harshnathani ,

 

Basically I have a table of data showing gameplay, and a table of tournaments, which specify the game and date range that needs to be applied as filters.  I need to have a drop down menu to select the tournament name, and based on this selection apply the correct gameguid and date range filters to the session history table to show relevant gameplay.

 

I can get this to work for the gameguid, which I have a relationship based on, but it does not apply the correct date range.

 

Thanks!

Kevin

amitchandak
Super User
Super User

@ksfx77 , Difficult to tell without data. Can you share sample data and sample output in table format?

 

See if this can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Hi @amitchandak,

 

Here you go.

 

session_history

GameGuidUserGuidStartTimeStopTime
746BE7F8-5D1B-4121-8BA7-8700CA5088565ef08c0c9f8b301d63145aaa10/07/2020 12:3710/07/2020 12:37
746BE7F8-5D1B-4121-8BA7-8700CA5088565a5f2f2e7cd9c2051ad655c310/07/2020 13:4310/07/2020 13:44
746BE7F8-5D1B-4121-8BA7-8700CA5088565edabc8eb2c42251f23fcddb10/07/2020 23:0910/07/2020 23:10
A2BA005D-84D9-47C8-BDBB-21EC61E1E9A95ef204d2d12efa61aa083d1b19/07/2020 17:3719/07/2020 17:38
746BE7F8-5D1B-4121-8BA7-8700CA5088565ef63ffab0ea0e6da2a7985502/07/2020 20:4702/07/2020 20:48
746BE7F8-5D1B-4121-8BA7-8700CA5088565f08c1839a354c22fcfdac9610/07/2020 19:3410/07/2020 19:35
746BE7F8-5D1B-4121-8BA7-8700CA5088565ced4d8c15ea5904fbfee60509/07/2020 16:0709/07/2020 16:08
A2BA005D-84D9-47C8-BDBB-21EC61E1E9A95ef204d2d12efa61aa083d1b17/07/2020 22:1717/07/2020 22:19
746BE7F8-5D1B-4121-8BA7-8700CA5088565ced4d7f15ea5904fbfedfdb11/07/2020 14:3511/07/2020 14:35
746BE7F8-5D1B-4121-8BA7-8700CA5088565d1a51fb115d7204fec8d84630/06/2020 09:4530/06/2020 09:46

 

tournaments

NameStartDateEndDateGameGuid
Tournament 117/07/202020/07/2020A2BA005D-84D9-47C8-BDBB-21EC61E1E9A9
Tournament 210/07/202013/07/2020746BE7F8-5D1B-4121-8BA7-8700CA508856

 

Hope this helps.

 

Thanks.

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.