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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mzorol
New Member

Funky Dax Behavior and Slicers!?

So I have a visual that displays data from a very large table that is related to a few other tables in a 1 to many.  When I add a simple dax formula to the visual, as "Y", such as:

rate=sum(absent)/count(present)

With the "X" set as a field (staff number) I get the expected results of rate by staff.  These staff members are filtered further by a slicer that filters a related table by site.

If I change the formula to:

rate=1-sum(absent)/count(present)

Then my filter from the related table dissapears and I get staff for the entire table nolonger filtered by site.

How can adding that simple constant cause this issue?  Any ideas?

1 ACCEPTED SOLUTION
xifeng_L
Super User
Super User

Hi @mzorol ,

 

Because the matrix automatically hides rows that have blank values throughout, after you change the formula to add constants, all rows no longer have blank values, thus making all rows visible, so it looks as if the slicer filtering is disabled.

 

You can change the formula to the following:

 

rate=
VAR Val = SUM(absent)/COUNT(present)
RETURN
IF(Val<>BLANK(),VAL)

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

 

View solution in original post

2 REPLIES 2
xifeng_L
Super User
Super User

Hi @mzorol ,

 

Because the matrix automatically hides rows that have blank values throughout, after you change the formula to add constants, all rows no longer have blank values, thus making all rows visible, so it looks as if the slicer filtering is disabled.

 

You can change the formula to the following:

 

rate=
VAR Val = SUM(absent)/COUNT(present)
RETURN
IF(Val<>BLANK(),VAL)

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

 

Thanks that was the issue.  I modified the formula slightly to att the constant back in so the last line reads:

IF(Val<>BLANK(),1-Val)

Work great.  This was great insight for me to learn.  Thanks again.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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