Forum Discussion

Mr_RLE's avatar
Mr_RLE
New Member
2 years ago

Small Multiples Breaking DAX Measure

Hello, I have the measure i have here below works as intended when i apply visual level filters to my visual. However, when i add my column dimCalendar[Day_of_week] to  small multiples or as a column or row in a matrix, my results are incorrect. 

 

For example, In October of 2023 i expect to return 5 Mondays, when the visual level filter is applied this works fine. When placed in a small multiple it returns 25, which throws my calculation off. 

 

Any guidance or explanation as to why this happens would be appreciated. 

 

Thanks, 

 

Avg Subs Sat as BD = 
VAR StartD=Min(dimCalendar[DAY_OF_MONTH]) 
VAR EndD=Max(dimCalendar[DAY_OF_MONTH]) 

VAR TotalBDInPeriod=CALCULATE( 
COUNTROWS(dimCalendar), 
FILTER( ALLSELECTED(dimCalendar), dimCalendar[BUS_DAY_FLAG]=1||dimCalendar[DAY_OF_WEEK]="Sat"), dimCalendar[DAY_OF_MONTH]>=StartD&&dimCalendar[DAY_OF_MONTH]<=EndD
 ) 


Return TotalBDInPeriod

 

4 Replies

  • Hi Mr_RLE 

     

    Would something like this help?

     

    Avg Subs Sat as BD =
    VAR StartD = MIN( dimCalendar[DATE] )
    VAR EndD = MAX( dimCalendar[DATE] )
    VAR TotalBDInPeriod =
        COUNTROWS(
            FILTER(
                ALLSELECTED( dimCalendar ),
                ( dimCalendar[BUS_DAY_FLAG] = 1
                    || dimCalendar[DAY_OF_WEEK] = "Sat" )
    			&& dimCalendar[DATE] >= StartD
                && dimCalendar[DATE] <= EndD
    		)
    	)
    RETURN
        TotalBDInPeriod

     

     

     

     

     

  • Thanks gmsamborn ,  I appreciate the assistance. Unfortunately this doesn't seem to correct my issue.

     

    This seems to return the same as the measure i have currently, outside  of the calculation for Sunday which is better but still not the correct number. 

     

    Day of WeekMy MeasureYour Measure
    Mon2525
    Tue2525
    Wed1919
    Thu1919
    Fri1919
    Sat1919
    Sun2924
    • gmsamborn's avatar
      gmsamborn
      Super User

      Hi Mr_RLE 

       

      I guess I'm a little unsure about your requirements.  Which visual are you using Small multiples on? 

       

      Could you share a pbix with any data that shows this particular situartion?

      • Mr_RLE's avatar
        Mr_RLE
        New Member

        Thanks for helping. I am not sure i can share a pbix as my data contains PII for some work  clients.  

         

        I am using an area chart with the small multiples, but it also breaks in a matrix if i add my [day_of_week] column to the matrix as a row or column.  if it's applied as a visual filter it doesn't break. 

         

        Essentially what i need to do is use the total business days in a period as the denominator for an average of customer tickets. I want to be able to slice this by day of week to provide that detail to my end users.