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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

DAX measure is ignoring / overriding filter on page

Background: this is for a web-based software application. Information is queried from AppInsights and centers around user actions. There are several dimension tables that filter the infromation by user group and other things

 

I have the following measure: 

Annotations =
IF(
CALCULATE(COUNTROWS(AppInsights), AppInsights[Event] = "change|appSpaces|annotation-create") = BLANK (),
0,
CALCULATE(COUNTROWS(AppInsights), AppInsights[Event] = "change|appSpaces|annotation-create")
)
 
This measure is designed to count rows with a specific value, the values are then returned in a table with other information (date, other counts, etc). That is working correctly. If the result is zero, it is supposed to return 0, it is doing that.
 
The problem is that it is returning a value of 0 for users outside of the filters. The filter on the page is for only users in group A. With the measure above, all users are being returned and then being attributed to group A. Note that this is not true when this measure is not used (so the relationship is working correctly).
 
Screenshots can be provided if they will help.
1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

@Anonymous just wrap everything with a condition on some other measure you have on that matrix. Somthing like:
IF ( [OTHER MEASURE] <> BLANK(),
...YOUR CODE.., BLANK())

Also, regrdless, use a varibale ovet there as the engine might calculate your base measure twice.


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@SpartaBI Will this still return 0 for the values I want? I still want it to return 0 for the blank ones of the users I am wanting to be in the table. 

 

There is a calculated value that, if blank, fits the criteria of not supposed to be in the table: COUNTROWS(AppInsights), AppInsights[Event]

 

I tried:

Annotations =
IF(
Calculate(COUNTROWS(AppInsights), AppInsights[Event] <> BLANK(),
IF(
CALCULATE(COUNTROWS(AppInsights), AppInsights[Event] = "change|appSpaces|annotation-create") = BLANK (),
0,
CALCULATE(COUNTROWS(AppInsights), AppInsights[Event] = "change|appSpaces|annotation-create")),
BLANK()))
 
And: 
Annotations =
IF(
Calculate(COUNTROWS(AppInsights), AppInsights[Event] <> BLANK(),
CALCULATE(COUNTROWS(AppInsights), AppInsights[Event] = "change|appSpaces|annotation-create"),
BLANK()))
 
Both received the error: Too few arguments were passed to the IF function. The minimum argument count for the function is 2.

@Anonymous I will pm you

SpartaBI
Community Champion
Community Champion

@Anonymous just wrap everything with a condition on some other measure you have on that matrix. Somthing like:
IF ( [OTHER MEASURE] <> BLANK(),
...YOUR CODE.., BLANK())

Also, regrdless, use a varibale ovet there as the engine might calculate your base measure twice.


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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