Forum Discussion

db1Intermtn's avatar
db1Intermtn
Helper I
7 years ago

Table Visual as per Slicer Selection

I have a table visual that should have totals of employees count for each BRANCH( as per REGION selection in slicer), company total.

 

Requirement: If the region of North is selected in the slicer then the table visual should display the values for branches in the north region. 

 

Problem: I am unable to get the branch wise values in the table visual as per the slicer.

I tried creating a measure for a branch and added it to the visual but when another region is selected, there is no data. 

 

Please see screenshot below for more details:

 

Measures I have used in the report

Company Total = 
VAR _TotalAvg =
    CALCULATE (
        CALCULATE (
            DISTINCTCOUNT ( EmployeeCount[EmployeeID]),
            ALL (Branch[Region] ),
            ALLSELECTED ( 'Date'[Year] )
        )
    )
RETURN
    IF (
        HASONEVALUE ( EmployeeCount[weeknum]),
        _TotalAvg,
        SUMX ( VALUES ( EmployeeCount[weeknum]), _TotalAvg )
    )
Manang = CALCULATE (
    DISTINCTCOUNT ( EmployeeCount[EmployeeID]),
    FILTER ( branch, branch[Branch] = "Manang" )
)

 

Can anyone please let me know how I can achieve this?

 

Thanks

5 Replies

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi db1Intermtn ,

     

    You may create measure like DAX below.

     

    Manang = CALCULATE ( DISTINCTCOUNT ( EmployeeCount[EmployeeID]), FILTER (ALLSELECTED( branch), branch[Region] = MAX(branch[Region] )))

     

    Or could you please share your sample data for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

     

    Best Regards,

    Amy

     

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