Forum Discussion
getitout
Helper I
6 years agoFilter 2 range of dates from the same table
Hi, I am very new to Power BI, need your advice. I would like to compare one column (e.g. Performance KPI) but from different date range e.g. Pre and Post Pre selection dates -Filter (slicer) Po...
- 6 years ago
hi getitout
You could refer to this blog:
Filtering and comparing different time periods with Power BI
Regards,
Lin
getitout
Helper I
6 years agoThere will be 2 slices since we want to select pre dates (range) and post date range, which is not overlapped.
Thanks for the comment, this is my first post. Will try to write clearer.
Ashish_Mathur
Super User
6 years agoHi,
I still do not understand. I am willing to help if you take a clear example and show the exact expected result.
- getitout6 years ago
Helper I
Thanks for all the suggestion.
I've got the solution from the community to use cross join
Parameters =var periods = VALUES(data[startday])return CROSSJOIN(SELECTCOLUMNS(periods,"Pre", [startday]),SELECTCOLUMNS(periods,"Post", [startday]))Average KPI=var period1 = CALCULATE(AVERAGE(data[KPI]),TREATAS(VALUES(Parameters[Pre]),pm[starttime]))var period2 = CALCULATE(AVERAGE(data[KPI]),TREATAS(VALUES(Parameters[Post]),data[startday]))return IF(period2>period1, "PASS", "FAIL")I will your suggested method as well.Thank you very much.