Forum Discussion
San_Raz
1 year agoFrequent Visitor
Marking Dates In Between Two Dates (for Displaying Time Spread in days of an activity)
I have two tables Table 1 : WorkSchedule Activity Date Expected Finish Client A 01/01/2025 04/01/2025 SS A 01/01/2025 3/01/2025 DD C 05/01/2...
- 1 year ago
Sorry for tytping mistake.
I have corrrected it
Answer = VAR mydate = SELECTEDVALUE('Calendar'[Date]) VAR tempfile = FILTER(yourdata, mydate >= yourdata[Start date] && mydate <= yourdata[Finish date] ) RETURN COUNTROWS(tempfile)
San_Raz
1 year agoFrequent Visitor
Its counting for all dates
speedramps
Super User
1 year agoSorry for tytping mistake.
I have corrrected it
Answer =
VAR mydate = SELECTEDVALUE('Calendar'[Date])
VAR tempfile =
FILTER(yourdata,
mydate >= yourdata[Start date] &&
mydate <= yourdata[Finish date]
)
RETURN
COUNTROWS(tempfile)
- San_Raz1 year agoFrequent Visitor
Perfect, Thanks.
I have a doubt, without relation between the two tables, how is the matrix visual able determine the relation between the coulmn and Rows.
Thanks in Advance- speedramps1 year ago
Super User
I hace added some explanatory commnents the DAX measure to help answer your question "how is the matrix visual able determine the relation between the coulmn and Rows without relation between the two tables."
When Power Bi plots a matrix it does the DAX calculation for each cell which will have natural filter context for the rows and columns.
Please click [accept solution] and thumbs up buttons. Thank you
Answer = // get the date for the column context on the visual VAR mydate = SELECTEDVALUE('Calendar'[Date]) // create a temp file of yourdate // which will naturally be filtered by the row Activity and Customer contect in the visual // but we add additional date filters VAR tempfile = FILTER(yourdata, mydate >= yourdata[Start date] && mydate <= yourdata[Finish date] ) RETURN // count the rows in the temp file for the visual cell context // which has Activity and Customer row context and Date column context COUNTROWS(tempfile)