Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Edit query to show MTD values

Hello everybody!

 

I need to edit all the graphs that I have easily by clicking on a switch "MTD".

 

I thought to create a filter with just one checkbox "MTD". By clicking it all graphs show me the MTD values, otherwise all the other values aka YTD.

 

The only problwem is that I don't have the MTD info, and moreover I want it to be automated. In excel I would easily make a combination of function, where if the month in the date is the current one, it gives me MTD, otherwise nothing.

 

Is there a way to create this editing the query in DAX format?

 

Thx in advance.

 

Cheers,

Andrea

  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi again tringuyenminh92 and parry2k,

     

    I made it to find out the formula to place in the query editor:

     

    = Table.AddColumn(#"Replaced Value2", "MTD", each if [Created] = Date.Month(DateTime.LocalNow()) then "MTD" else null)

     

    Thanks anyway for the help!

4 Replies