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.

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.

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.