Forum Discussion

GabrielGloria's avatar
GabrielGloria
New Member
3 years ago

ALL SELECTED,

Hello, everyone!

Im beggining with DAX languages, power BI, Power Pivot and etc.

Im using dax in a excel Pivot analysis and im with problemas with context filters.


This is my Data of one process that the stores have until 2 days to do the process.
And when it doesnt do, a flag is generated.
I will generate the average and the standard deviaton, and give pontuations, 1 for stores that average is between average and average + std dev and 3 for stores that are over the Averaga+std dev.


I have jul and aug data for more than 300 stores divided by 3 districts.

I create a pivot but i cannot filter ok.

I use:

Average Flags:= CALCULATE (AVERAGE(FT_Check[Flags]); ALLSELECTED(FT_Check))

and

Std Dev:= CALCULATE (STDEV.P(FT_Check[Flags]); ALLSELECTED(FT_Check))

But i remove all internal filters and mantain the externals with ALLSELECTED.

Is there some solution to remove all filters and mantain just the "begin date" with external filter ok?

Example:


But when i filter the district, the Averages and Std Devs changing, like:

 

Could i use to "ALL" formulas inside the "Calculate"?

4 Replies

  • So do you want to ignore filters only for the stores?
    For this you can put only those columns in allselected you want to ignore. 

    Average Flags:=CALCULATE(AVERAGE(FT_Check[Flags]);ALLSELECTED(FT_Check;FT_Check[Store]))

    Std Dev:=CALCULATE(STDEV.P(FT_Check[Flags]);ALLSELECTED(FT_Check;FT_Check[Store]))


    let me know if that works. else if you want we can connect @91-9711975011 or [email protected]
    Thanks
    Deevaker Goel

    https://www.linkedin.com/in/deevakerg/

    • GabrielGloria's avatar
      GabrielGloria
      New Member

      Thanks!!

      But it doesnt work yet.

      i want that my average calculates freezy with all the filters except about the period of time.

      Example:

      Stores of
      Dist 1: ABC, DEF and GHI.
      Dist 2: XYZ, JKL and QWE.

      When I filter July, the average of all stores was 25%.

      I want the tabel shows 25% in this column independent of the district filter at slicer.

      But Thank you so much!!

  • You can try allexcept() function where just put those column name that should not be ignored from filter like your external columns and/or begin date

    • GabrielGloria's avatar
      GabrielGloria
      New Member

      Hi Deevaker!

      Have i put ALLEXCEPT like a "filter2" in Calculate?

      I ve tried these:

      Average Flags:=CALCULATE(AVERAGE(FT_Check[Flags]);ALLEXCEPT(FT_Check;FT_Check[Begin Date]))

      Std Dev:=CALCULATE(STDEV.P(FT_Check[Flags]);ALLEXCEPT(FT_Check;FT_Check[Begin Date]))

      But it doesnt work, because the average and std dev, use all the database, independent of the filters: