Forum Discussion

Deemo's avatar
Deemo
Icon for Advocate II rankAdvocate II
6 years ago
Solved

Ignore selected columns and filter while calculating measures

Hi All,

 

Scenario is that we have to display those flows which are being used in more than one department based on selected date filter and department.

 

Below is the sample data(department ,flow are dimensions)

DepartmentFlowDateValue
Dept 1Flow1May7
Dept 1Flow2June2
Dept 1Flow3July10
Dept 1Flow4Aug6
Dept 2Flow3June15
Dept 2Flow5June4
Dept 3Flow1May19
Dept 3Flow3July3
Dept 3Flow4Aug4

 

Axis= Flow

Legend = Department

Value = sum of Value

If we select,Department : All  and Date : June - July

Result should be Flow3 , in legend we will have Dept1(10), Dept2(15) and Dept3(3)

 

If we select,Department : Dept1 and Date : May

Result should be Flow1 , in legend we will have Dept1(10)

 

When we simply create a measure with DISTINCTCOUNT(Department), it doesn't work as in the table I have department,flows,values columns. Even after using ALLEXCEPT , it is including department column while calculating count and which always shows 1.

 

Please help!!

 

 

 

 

 

 

 

  • Hi Deemo ,

     

    Please create a measure and apply it in visual level filter.

    Measure 3 =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Department] ),
        ALLSELECTED ( 'Table'[Date], 'Table'[Department] ),
        REMOVEFILTERS ( 'Table'[Department] )
    )

    .PBIX file

     

     

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

4 Replies

  • V-lianl-msft's avatar
    V-lianl-msft
    Icon for Community Support rankCommunity Support

    Hi Deemo ,

     

    Sorry, I can't know what the result you want. You can describe it in more detail, or share the sample pbix file.

    How is "no. of executions" calculated?
    What do you want by calculating "distinctcount (Department)"?

     

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

    • Deemo's avatar
      Deemo
      Icon for Advocate II rankAdvocate II

      Thanks for the reply Liang.Added sample data. Please check.

      I actually want to calculate count (distinct department) group by flow and date(as per the date selected in filter). We need to display only those flow which are being used more than once in different account.

       

       

       

      • V-lianl-msft's avatar
        V-lianl-msft
        Icon for Community Support rankCommunity Support

        Hi Deemo ,

         

        Please create a measure and apply it in visual level filter.

        Measure 3 =
        CALCULATE (
            DISTINCTCOUNT ( 'Table'[Department] ),
            ALLSELECTED ( 'Table'[Date], 'Table'[Department] ),
            REMOVEFILTERS ( 'Table'[Department] )
        )

        .PBIX file

         

         

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