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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

How can I get records from a table which is greater than selected date and show it on table viz.

I have a data model which as two dimension table and a fact table. I want to get all records from fact which is greater that selected date(from date slicer). It means whatever rows are going to return from that selected date.

Below is the model:-

anupaminfo_0-1679504326731.png

 

Viz Example:-

anupaminfo_1-1679504405081.png

I want all the columns from fact table which is greater than selected date.

In term of sql:- 
Select
f.ServiceDistrict,
f.STORE_ID,
f.SERVICE_CALL,
f.APPOINTMENTDATE,
f.SERVICE_NM,
f.ACTIONSTATUS,
f.SALESREP
from V_DAILY_SERVICE_INSTALL f
inner join V_DATE_DIM d on f.DT_SKEY = d.DT_SKEY
inner join V_STORE_SERVICE_DIM s on f.STORE_KEY = s.STORE_KEY
where d.CAL_DT  > '2023-02-21' and SERVICE_DSTRCT_NM = 'SERV DIST 10 - OKC, TULSA'

 

How can I handle this where clause in power bi mean to say return rows which is greater Selected Date.

P.S:- We are not performimg any sort of aggregation over any column...

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the response, @Anonymous .

I fixed this issues by create a new table by summarize and filter it on the selected date. Then put that table in the relationship with other Dimension table only. This way Issue was resolved.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks for the response, @Anonymous .

I fixed this issues by create a new table by summarize and filter it on the selected date. Then put that table in the relationship with other Dimension table only. This way Issue was resolved.

Anonymous
Not applicable

Hi @Anonymous ,

First, please make sure that DON'T create any relationship between the table which the date field applied in slicer exist in and your fact table. You can delete the relationship between the table 'V_DATE_DIM' and the table 'V_DAILY_SERVICE_INSTALL'. Or you can create another new Date table and apply the date field on the slicer.  Then create a measure as below and apply a visual-level filter with the condition(Flag is 1😞

Flag =
VAR _seldate =
    SELECTEDVALUE ( 'V_DATE_DIM'[CAL_DT] ) //var _seldate=selectedvalue('newdatetable'[Date])
VAR _selappdate =
    SELECTEDVALUE ( 'V_DAILY_SERVICE_INSTALL'[APPOINTMENTDATE] )
RETURN
    IF ( _selappdate > _seldate, 1, 0 )

vyiruanmsft_0-1679648707999.png

If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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