Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Deemo
Helper II
Helper II

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

image.png

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!!

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

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] )
)

test_ignore.PNG

.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.

View solution in original post

4 REPLIES 4
V-lianl-msft
Community Support
Community 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.

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.

 

 

 

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] )
)

test_ignore.PNG

.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.

Thanks Liang.

I am getting error for REMOVEFILTERS (Cannot find name) and second part of ALLSELECTED (Unexpected parameter)

ALLSELECTED ( 'Table'[Date], 'Table'[Department] ),
    REMOVEFILTERS ( 'Table'[Department] )

I am connected to SSAS. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.