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
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors