Forum Discussion
Summarizing columns from three different date ranges(Please let me know if this the correct approah)
I have created a report that would filter based on three date ranges as below
DateFilterRange = IF(MAX(vw_patientListNew[StatusDate]) in UNION(VALUES(DateRange1[Date]),VALUES(DateRange2[Date]),VALUES(DateRange3[Date])),1)
Now i want to summarize it like the table below
| TimeFrameDateRangeCol1 | TimeFrameDateRangeCol2 | TimeFrameDateRangeCol3 | |
| Interventional TX | 23 | 65 | 12 |
| Interventional Non TX | 1 | 34 | 19 |
TimeFrameDateRangeCol1 =
IF(MAX(vw_patientListNew[StatusDate]) in VALUES(DateRange1[Date]),1)TimeFrameDateRangeCol2 =
IF(MAX(vw_patientListNew[StatusDate]) in VALUES(DateRang2[Date]),1)TimeFrameDateRangeCol3 =
IF(MAX(vw_patientListNew[StatusDate]) in VALUES(DateRange3[Date]),1)
TimeFrameDateRangeCol1, TimeFrameDateRangeCol2, TimeFrameDateRangeCol3 are calculation column and should return 1 when the statusdate intersect the respective filter. As you can see i am not able to achieve with the Daxcode.
Once i get the values for the each collumn TimeFrameDateRangeCol1, TimeFrameDateRangeCol2, TimeFrameDateRangeCol3 i can summarize TimeFrameDateRangeCol1, TimeFrameDateRangeCol2, TimeFrameDateRangeCol3 to create a summary table.
Is there another solution to this?
12 Replies
- amitchandak
Super User
Anonymous , three slicers should be coming from three date tables or three-column. You might have ignore the other when one is working.
refer to this example for two date ranges
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601
- parry2k
Super User
Anonymous not sure how tables are connected like slicers are from disconnected tables, you have to add your calculation as measures, not columns
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- AnonymousNot applicable
These are the tables from where slicer data is coming.
I have added the calculation measure and i cannot summarize the data. I can only summarize the data with a column.
My goal here is to create a summarized table as shown in my post.
- AnonymousNot applicableSpoileramitchandak Yes the slicers are coming from three different date tables, exactly as you mention in the article link.
As you can see above the slicer data is coming from three different tables.
- richbenmintz
Resident Rockstar
Hi Anonymous,
Are you able to provide some sample data and what the expected outcome would be. One thing to note is that calcuated columns do not evaluate in the context of any filters or slicers applied to the report, they are calcluated when the model is processed, the values are then locked in place. Measures on the other hand are evaluated when the model is queried by the report.
Hope that makes sense