Forum Discussion

H3nning's avatar
H3nning
Icon for Helper V rankHelper V
2 years ago
Solved

Measure not affected by Slicer

Hi,

i have this measure and I wonder why it is not affected by my slicer A and B

COUNTROWS(
                    FILTER(
                        SUMMARIZE(FILTER(ALLEXCEPT(Werte_kurz,Firmendimension[A],Firmendimension[B]), Werte_kurz[_*EndeDatum] >= MinDatum && Werte_kurz[_*StartDatum] <= MaxDatum)
                            ,Werte_kurz[_Firma]
                        ),
                        NOT(ISBLANK(Werte_kurz[_Firma]))
                    )
                )
 
are nested Filter Expression killing the context filter somehow?
 
Firmendimension is a connected dimensional table (* to1) and MaxDatum and MinDatum are variables. The measure at it is is not my problem. It is about the non functioning slicesr.
 
Thank you!!!
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi H3nning ,

    The Table data is shown below:

    The relationship between tables is as follows:

    Regarding your question, there should be a problem with the dax expression you provided, please follow these steps:
    1. Use the following DAX expression to create a measure (Replace 'Date(2024.2.1)' and 'Date(2024.2.15)' with 'MinDatum' and 'MaxDatum' in the expression)

    Measure = CALCULATE(
        COUNTROWS(
            FILTER(
                SUMMARIZE(FILTER('Werte_kurz','Werte_kurz'[StartDatum] >= DATE(2024,2,1) && 'Werte_kurz'[EndDatum] <= DATE(2024,2,15)),[Firma]),
                NOT(ISBLANK('Werte_kurz'[Firma])))),ALLEXCEPT(Werte_kurz,'Firmendimension'[A],'Firmendimension'[B]))

    2. Final output ("Measure2" is the dax expression you supplied.)

    Best Regards,
    Wenbin Zhou
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi H3nning ,

    The Table data is shown below:

    The relationship between tables is as follows:

    Regarding your question, there should be a problem with the dax expression you provided, please follow these steps:
    1. Use the following DAX expression to create a measure (Replace 'Date(2024.2.1)' and 'Date(2024.2.15)' with 'MinDatum' and 'MaxDatum' in the expression)

    Measure = CALCULATE(
        COUNTROWS(
            FILTER(
                SUMMARIZE(FILTER('Werte_kurz','Werte_kurz'[StartDatum] >= DATE(2024,2,1) && 'Werte_kurz'[EndDatum] <= DATE(2024,2,15)),[Firma]),
                NOT(ISBLANK('Werte_kurz'[Firma])))),ALLEXCEPT(Werte_kurz,'Firmendimension'[A],'Firmendimension'[B]))

    2. Final output ("Measure2" is the dax expression you supplied.)

    Best Regards,
    Wenbin Zhou
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • H3nning's avatar
      H3nning
      Icon for Helper V rankHelper V

      Thank you Anonymous ! Funny thing I tried this, but kept the allexept in the the place where i had it in the original expression. So two times allexept, one in the spot of my original expression and one as in the solution. Like this:

      CALCULATE(
          COUNTROWS(
              FILTER(
                  SUMMARIZE(FILTER(ALLEXCEPT(Werte_kurz,'Firmendimension'[A],'Firmendimension'[B]),'Werte_kurz'[StartDatum] >= DATE(2024,2,1) && 'Werte_kurz'[EndDatum] <= DATE(2024,2,15)),[Firma]),
                  NOT(ISBLANK('Werte_kurz'[Firma])))),ALLEXCEPT(Werte_kurz,'Firmendimension'[A],'Firmendimension'[B]))

      That didn't work out and slicer didnt work, although the measure did not throw any errors. Can someone explain why?