Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Filter Table Userelationship

I'm working with a DAX function called “Name of Application,” which is supposed to replace the tbl_application[Name] column in my table using a field parameter. The function should display values only for the defined filter context.

When I include both the Name column and the Name of Application function in my model, the Name of Application column shows the expected values. However, if I remove the Name column from the table, I would expect only those rows to remain that previously contained a value in Name of Application. Instead, a significantly higher number of rows are filtered out, and the content displayed is incorrect.

What could be causing this issue? What changes do I need to make to ensure that Name of Application behaves as expected?

 
Name of Application =
IF (
    COUNTROWS(ALLSELECTED(tbl_entity[Type])) <> DISTINCTCOUNT(tbl_entity[Type]),
    CALCULATE (
        CALCULATE(
            FIRSTNONBLANK(tbl_application[Name],1),
            USERELATIONSHIP(tbl_application[Entity]  ,tbl_entity[Name]),
            USERELATIONSHIP(tbl_co_license_application[Vendor]  ,tbl_vendor[Name])
        ),
        CROSSFILTER(tbl_data_object[Application ID], tbl_application[Application ID], Both)  
    ),
    CALCULATE(
        FIRSTNONBLANK(tbl_application[Name],1),
        USERELATIONSHIP(tbl_application[Entity]  ,tbl_entity[Name]),
        USERELATIONSHIP(tbl_co_license_application[Vendor]  ,tbl_vendor[Name])
    )

With the colum tbl_application[Name]:

 

 

Without the colum tbl_application[Name]:

 

3 Replies

  • Hi,

     

    A measure gives results based on the defined logic against some axis or rows which should come from column. in your first visual, as you are refering the Name column, the measure displaying desired data as values. If you use Measure as axis, it will show a scaler value only. In this context, you need to put the above filter logic on all the value parameters you lik to display against Names and then use Name as row/Axis to get correct representation. Hope you understand this else, please share sample data

  • Anonymous.

     

    You could set the column width of tbl_application[Name] to zero, which would hide the field visually, rather than actually removing the field.

     

     

    Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

     

    Thank you~

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      For now, it's a simple fix that works. Thank you! However, I'm not sure if I'll encounter other issues in the future that might require a different solution.