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
AW1976NOVA
Post Patron
Post Patron

Need to update DAX measures to consider a page filter (complex problem)

Hi,

 

I have three measures that are working correctly...although I now need to update them in order to consider one of the page filters I have added to the page.

 

Here are my current measures that I need to update:

7 Day Readmission Rate Delta v2 =
IF (
SELECTEDVALUE ( 'Successful Intervention Passthrough'[Result] ) <> "Total",
CALCULATE (
SUM ( 'Post Call to Home Append'[7 Day Readmit flag] ) / SUM ( 'Post Call to Home Append'[EASY COUNT] ),
FILTER (
ALL ( 'Post Call to Home Append' ),
[Successful Intervention Column] = SELECTEDVALUE ( 'Successful Intervention Passthrough'[Result] )
)
),
CALCULATE (
SUM ( 'Post Call to Home Append'[7 Day Readmit flag] ) / SUM ( 'Post Call to Home Append'[EASY COUNT] ),
FILTER ( ALL ( 'Post Call to Home Append' ), [Successful Intervention Column] IN { "Yes","No"}
)

))

 

14 Day Readmission Rate Delta v2 =
IF (
SELECTEDVALUE ( 'Successful Intervention Passthrough'[Result] ) <> "Total",
CALCULATE (
SUM ( 'Post Call to Home Append'[14 Day Readmit flag] ) / SUM ( 'Post Call to Home Append'[EASY COUNT] ),
FILTER (
ALL ( 'Post Call to Home Append' ),
[Successful Intervention Column] = SELECTEDVALUE ( 'Successful Intervention Passthrough'[Result] )
)
),
CALCULATE (
SUM ( 'Post Call to Home Append'[14 Day Readmit flag] ) / SUM ( 'Post Call to Home Append'[EASY COUNT] ),
FILTER ( ALL ( 'Post Call to Home Append' ), [Successful Intervention Column] IN { "Yes","No"}
)

))
 
30 Day Readmission Rate Delta v2 =
IF (
SELECTEDVALUE ( 'Successful Intervention Passthrough'[Result] ) <> "Total",
CALCULATE (
SUM ( 'Post Call to Home Append'[30 Day Readmit flag] ) / SUM ( 'Post Call to Home Append'[EASY COUNT] ),
FILTER (
ALL ( 'Post Call to Home Append' ),
[Successful Intervention Column] = SELECTEDVALUE ( 'Successful Intervention Passthrough'[Result] )
)
),
CALCULATE (
SUM ( 'Post Call to Home Append'[30 Day Readmit flag] ) / SUM ( 'Post Call to Home Append'[EASY COUNT] ),
FILTER ( ALL ( 'Post Call to Home Append' ), [Successful Intervention Column] IN { "Yes","No"}
)

))

 

As you can see in the following image, these three measures are being used as the Column Values of the visual.  You'll also notice that I am using the field Result as the Shared Axis:

Capture.PNG

 

These measures are all calculating correctly for all Groups.  But I now need to have a page drop down filter where I can select a specific group and have this bar chart visual update based on the selection.  As you can see in the photo above, I have added the filter. However, when I change a selection it is not interacting with the visual.

 

Here is an image of the relationship map:

Capture2.PNG

 

- The Employer Group filter is populated with the Group Name field in the EmployerGroups table

- The EmployerGroups table has a one to many relationship with the Post Call to Home Append table based on the Group ID column which is present in both tables

- I needed to create the Successful Intervention Passthrough table in order to assist in being able to create the Totals result...so I could plot Total, Yes and No results on the same table.

 

But now, with the three formulas that I mentioned earlier...I have no idea how to update them (how to re-write them) so they will interact with the Employer Group filter...because the Employer Group filter (that is populated by the field Group Name in the table Employer Groups) has no direct relationship with the Successful Intervention Passthrough table.

 

Can you PLEASE assist me here????

 

 

 

 

Thank you,

Andrew

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @AW1976NOVA 

ALL function ignores all filters, regardless of where they are coming from. In contrast, the ALLSELECTED function only ignores filters that are coming from the inner query.

Take a try  to replace  ALL function with ALLSELECTED function.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @AW1976NOVA 

ALL function ignores all filters, regardless of where they are coming from. In contrast, the ALLSELECTED function only ignores filters that are coming from the inner query.

Take a try  to replace  ALL function with ALLSELECTED function.

 

Best Regards,
Community Support Team _ Eason

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.