Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Month Cards

Hello everyone. I have some monthly cards I made for to quickly see current situation for a use case. They work untill I use a slicer till I use date slicers/filters which is logical. So I want them to ignore any filters I use on my visuals I guess to work with FILTER() and ALL() but I can't figure it out. I have following cards:

 

MonthVariance = 

([Billable MTD]-[Billable LMTD])/[Billable LMTD]
Year Variance = 
([Billable MTD]-[Billable LY MTD])/[Billable LY MTD]
Billable Last Month = 
CALCULATE([Billable],DATESMTD(dateadd(fact_harvest_time[date_id],-1,,MONTH)))
Billable Current Month = 
CALCULATE([Billable],DATESMTD(dateadd(fact_harvest_time[date_id],-1,,MONTH)))
Billable CM Last Year = 
CALCULATE([Billable],DATESMTD(ENDOFMONTH(dateadd(fact_harvest_time[date_id],-12,,MONTH))))
 Billable = SUM([Billable Amount])
 
 
Anyone know how to re-write the DAX formules in order to make them ignore filters/slicers on my visual?
 
Thanks!

 

  • You can switch off interactions

    And have visual level filter on date.

6 Replies

  • You can switch off interactions

    And have visual level filter on date.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Cool, this worked! But it should also be doable with DAX-code right?

  • AilleryO's avatar
    AilleryO
    Memorable Member

    Hi,

     

    To remove all filters from a table you can add in your formula :

    ALL(fact_harvest_time)

    ALL functions accept a table or a specific column from a table as argument, so to remove from all columns just use the table name as argument in your all function.

    so It will make something like :

    =CALCULATE([yourmeasure],ALL(fact_harvest_time);...rest of calculation)

     Let us know if it works,

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey AilleryO I tried this but didn't seem to work:

       

      Billable CM Last Year= CALCULATE([Billable],All(fact_harvest_time),DATESMTD(ENDOFMONTH(dateadd(fact_harvest_time[date_id],-12,,MONTH))))
       
      I also tried this but this gave an error (a table of multiple values was supplied where a single value was expected)
      Billable LY MTD = CALCULATE([Billable],FILTER(All(fact_harvest_time),DATESMTD(ENDOFMONTH(dateadd(fact_harvest_time[date_id],-12,,MONTH)))))
      • AilleryO's avatar
        AilleryO
        Memorable Member

        Hi Anonymous ,

         

        Is your slicer based on this table : fact_harvest_time ?