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
Giorgi1989
Advocate II
Advocate II

Applying filter to only some elements of the measure

Dear All,

 

Would appreciate a bit help on this:

 

I am using this formula:

 
  • RM impact Apr 2022 = CALCULATE([RM impact Mar 2022]*(1+([Raw Mat %]*([RM index Apr 2022]/[RM index Mar 2022]-1))),ALL('RM index'[Month]))

I want ALL filter function NOT to apply to the sub-measure [Raw Mat %]. Any smart ways of doing this?

 

Thank you.

 

1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

@Giorgi1989 

 

RM impact Apr 2022 =
	CALCULATE (
	    [RM impact Mar 2022],
	    ALL ( 'RM index'[Month] )
	)
	* ( 1 + ( [Raw Mat %] * CALCULATE( [RM index Apr 2022] / [RM index Mar 2022],ALL ( 'RM index'[Month] )) - 1 ) )

 


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

View solution in original post

5 REPLIES 5
Giorgi1989
Advocate II
Advocate II

I seem to have resolved the issue I had, largely thanks to you. Many thanks! I will mark this as solved! 

@Giorgi1989 my pleasure 🙂
Hey, check out my showcase report - got some high level stuff there 🙂
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
Give it a thumbs up over there if you liked it 🙂

SpartaBI
Community Champion
Community Champion

@Giorgi1989 

 

RM impact Apr 2022 =
	CALCULATE (
	    [RM impact Mar 2022],
	    ALL ( 'RM index'[Month] )
	)
	* ( 1 + ( [Raw Mat %] * CALCULATE( [RM index Apr 2022] / [RM index Mar 2022],ALL ( 'RM index'[Month] )) - 1 ) )

 


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

Thank you for such a quick reply. 

 

The problem I have with that approach is that that would apply the filter to the [Raw Mat %] measure for priot month.


This is essentially how I have my formulae:

 

RM impact May 2022 = CALCULATE([RM impact Apr 2022]*(1+([Raw Mat %]*([RM index May 2022]/[RM index Apr 2022]-1))),ALL('RM index'))
RM impact Apr 2022 = CALCULATE([RM impact Mar 2022]*(1+([Raw Mat %]*([RM index Apr 2022]/[RM index Mar 2022]-1))),ALL('RM index'))
RM impact Mar 2022 = CALCULATE([RM impact Mar 2022]*(1+([Raw Mat %]*([RM index Mar 2022]/[RM index Feb 2022]-1))),ALL('RM index'))
RM impact Feb 2022 = CALCULATE([RM impact Feb 2022]*(1+([Raw Mat %]*([RM index Feb 2022]/[RM index jan 2022]-1))),ALL('RM index'))
Etc. until Jan 2021. 

@Giorgi1989 hard to understand with the info supplied 🙂
In the version I sent the ALL hits all excpet the measure you wanted to exclude.
Maybe better to share a sample file with the desired results.

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.

Top Solution Authors