cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gerdinve
Frequent Visitor

filter context if function

I defined the following measure on a filtered context which is enabled by a slicer. This archieved the desired result, i.e. the measure gives the right value and only for the records I selected by the slicer.

 

Measure =
VAR
Sales = SUMX(SALES_90_DAYS;SALES_90_DAYS[SALES_AMT_90_DAYS])
VAR
DSO = (SUMX(DTM_AR_OPEN_BALANCE_HIST; DTM_AR_OPEN_BALANCE_HIST[AMT_REMAINING_LINES_SOB])/Sales)*90

RETURN
DSO

 

As an improvement of this measure I would like to replace the returned DSO with another value for specific situations of Sales. I did several tries but with no succes. All the tries I did (like the one ahead), calculated the metric well for the records selected by the slicer but the problem is that the filter of the slicer get enabled, i.e. all records are visible in the table instead of only the records I selected by the slicer.

 

How can I resolve this?

 

Measure =
VAR
Sales = SUMX(SALES_90_DAYS;SALES_90_DAYS[SALES_AMT_90_DAYS])
VAR
DSO = (SUMX(DTM_AR_OPEN_BALANCE_HIST; DTM_AR_OPEN_BALANCE_HIST[AMT_REMAINING_LINES_SOB])/Sales)*90

RETURN
 IF (DSO<200; 'Good';'Bad)

 

 

1 ACCEPTED SOLUTION

Sorry for the late response. I already discovered yet. The cause was a incompleteness in the relationships between the tables.

Thanks for your response.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Microsoft
Microsoft

Hi, @gerdinve

 

Based on current description, I am confused about your issue. Would you please share some sample data and screenshots of you report design? If possible, you can upload the .pbix file for further analysis.

 

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sorry for the late response. I already discovered yet. The cause was a incompleteness in the relationships between the tables.

Thanks for your response.

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors