2
$\begingroup$

Goal: I am trying to filter a line chart that has trends both 3 months back and 6 months out (a total of a 10 month block).

Attempted Method: I tried to create a binary DAX-based yes/no filter as a column in a selected query based on the End date column.

I have the code for my attempt at creating this formula shown below.

My code:

DateBridge = 
VAR TodayMonthYr = VALUE(FORMAT(today(),"YYYYMM") 
VAR EndMonthYr = VALUE(FORMAT([End],"YYYYMM")

RETURN 
IF(
   AND(
       EndMonthYr > TodayMonthYr - 3 , 
       EndMonthYr < TodayMonthYr + 6
   ),
   "Yes" , "No"
)
$\endgroup$
4
  • $\begingroup$ Are you planning to use analytical/windowing functions? en.wikibooks.org/wiki/Structured_Query_Language/… $\endgroup$ Jul 24, 2019 at 19:52
  • $\begingroup$ Please make sure to format all code as markdown when in the body of questions. This makes it easier for people to read and understand what you are asking in turn learning to a higher chance of getting your question answered. $\endgroup$
    – Ethan
    Jul 24, 2019 at 20:44
  • $\begingroup$ @javadba - Looking at your link, I think DAX is already a bit overwhelming enough. My brain is still too Excel centric. This feels a bit further than I'm prepared to comprehend, atm! $\endgroup$
    – naridox
    Jul 25, 2019 at 12:27
  • 1
    $\begingroup$ @Ethan - Roger! $\endgroup$
    – naridox
    Jul 25, 2019 at 12:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.