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 September 15. Request your voucher.
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:-
Viz Example:-
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...
Solved! Go to Solution.
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.
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.
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 )
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
User | Count |
---|---|
69 | |
64 | |
62 | |
55 | |
28 |
User | Count |
---|---|
203 | |
82 | |
65 | |
48 | |
38 |