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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Niiru1
Helper V
Helper V

Additional Filter to text and calculation measure

I'm currently trying to add an additional filter to my measure which I'm using in a card. The measure contains both calculations and text:
 
Title A = 
"Number of Events (N= " &
CALCULATE(IF(CALCULATE(COUNT('Sheet1'[Event Identifier])=BLANK()),0,CALCULATE(COUNT('Sheet1'[Event Identifier])))
,FILTER('Sheet1','Sheet1'[Location] in {"Hospital"})) & ")"
 
 
What I'm trying to do is add an additional filter  to only contain values for weeks 16 and above e.g.
Title A =
"Number of Events (N= " & CALCULATE(CALCULATE(IF(CALCULATE(COUNT('Sheet1'[Event Identifier])=BLANK()),0,CALCULATE(COUNT('Sheet1'[Event Identifier]))),FILTER('Sheet1','Sheet1'[Location] in {"Hospital"})),FILTER('Sheet1','Sheet1'[Outbreak Week] >= {"32"})) & ")"
 
Is this possible via DAX?
 
File attached:
Thanks in advance
1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Niiru1   ,

Here are the steps you can follow:

1. Create measure.

Title A =
"Number of Events (N= " & CALCULATE(IF(CALCULATE(COUNT('Sheet1'[Event Identifier])=BLANK()),0,CALCULATE(COUNT('Sheet1'[Event Identifier]))),FILTER('Sheet1','Sheet1'[Location] in {"Hospital"}&&'Sheet1'[Outbreak Week]>=16)) & ")"

2. Result

v-yangliu-msft_0-1607475927472.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @Niiru1   ,

Here are the steps you can follow:

1. Create measure.

Title A =
"Number of Events (N= " & CALCULATE(IF(CALCULATE(COUNT('Sheet1'[Event Identifier])=BLANK()),0,CALCULATE(COUNT('Sheet1'[Event Identifier]))),FILTER('Sheet1','Sheet1'[Location] in {"Hospital"}&&'Sheet1'[Outbreak Week]>=16)) & ")"

2. Result

v-yangliu-msft_0-1607475927472.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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