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
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
Employee
Employee

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.

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.