Forum Discussion

Txtcher's avatar
Txtcher
Helper V
1 year ago
Solved

Dax function RELATED - How Do I Apply It?

I have the following measure: Licensing NA Approved Apps = CALCULATE( Min(HX[HXDate]),RELATED(Users[Id]), HX[NewValue] = "Approved") Works perfectly. But now I need to lim...
  • Txtcher's avatar
    Txtcher
    1 year ago

    After doing some due diligence (reading and learning) about Row Context, Filter Context, Calculate, thanks to videos frm SQLBI, I think I have a better grasp of how the slicers and visuals work.

    I think I fixed the problem without writing any DAX. 

    I simply added a filter to the entire page for User[Id] is not Blank. That filtered my table visual and the card visual. This works because the goal is to demonstrate how many applications were approved for the selected date, but only those approved by a User from the User table. There will never be a business reason to include those that are approved by any entity outside of the User table.

    My thanks & my apologies to DataNinja777 . It appears I messed up my OP.  The original measure to count the rows in the table visual was this:

    Total NA Apps Approved = 
    
    COUNTROWS(
        SUMMARIZE(
            FILTER('NA Apps',
              [Approved]),
              'NA Apps'[Id]
        )
    )

     

    I failed to communicate that I needed a count of all approved apps by users only. Not counts of how many apps approved by individual users.

    But that would be a good slicer to add for management overview.

    Thank you for your response.