cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OzzieFrog Member
Member

Re: Replace character when not in a word

Super User
Super User

Re: Replace character when not in a word

@OzzieFrog

 

Quick solution. Probably not the most elegant. Unfortunately SUMMARIZECOLUMNS( ) seems not to be fully supported in a modified filter context yet so that's a drag. We thus cannot use the earlier approach that invokes [Discipline (Measure)], which would be waaay smoother. With some more work we might find a solution for that and get something more elegant but this should do:

 

 

MeasureNumDisplayedDrawings2 = 
COUNTROWS (
    FILTER (
        'All Documents';
        VAR CurrentDiscipline = 'All Documents'[Discipline]
        VAR CountOfDisciplines =
            SUMX (
                FilterTableDiscipline;
                MIN (
                    FIND ( FilterTableDiscipline[Discipline]; CurrentDiscipline; 1; BLANK () );
                    1
                )
            )
        RETURN
            IF ( CountOfDisciplines > 0; 1 )
            = 1
    )
)

 

Code formatted with   www.daxformatter.com

Highlighted
Super User
Super User

Re: Replace character when not in a word

@OzzieFrog

 

Or in fact a leaner version:

 

MeasureNumDisplayedDrawings2_V2 =
COUNTROWS (
    FILTER (
        'All Documents';
        SUMX (
            FilterTableDiscipline;
            FIND ( FilterTableDiscipline[Discipline]; 'All Documents'[Discipline]; 1; 0 )
        )
            > 0
    )
)

Code formatted with   www.daxformatter.com

OzzieFrog Member
Member

Re: Replace character when not in a word

@AlB, I have no idea what you've done, but it works perfectly.

 

Thank you very very much, I really appreciate your help.

Super User
Super User

Re: Replace character when not in a word

@OzzieFrog

You're very welcome. Cool to hear it finally works.

The logic behind this last measure is very similar to that of the previous one. We merrily step through the 'All documents' table and, for each row, we check whether any of the disciplines selected in the slicer can be found within the Disciplines for the drawing. If so, we've found one drawing of interest and we include that row in the total count.