Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Filter in Summarize in Dax

I have a dax code as follows and I need to add a filter argument but somehow the result is coming unexpected. 

 

 

VAR CurrencyAmounts =
 SUMMARIZE(
    FILTER(facttable, facttable[COL] = "abc"),
                facttable[Currency], 'facttable'[Amount])

 

 

 

Rate_1_Equivalent = 
VAR CurrencyAmounts = SUMMARIZE('Facttable', facttable[Curreny], 'Facttable'[Amount])
VAR USD_Rate_1 = MAXX(FILTER('slicertable', slicertable[Curreny] = "usd"), 'slicertable'[rate_1])
VAR EUR_Rate_1 = MAXX(FILTER('slicertable', slicertable[Curreny] = "eur"), 'slicertable'[rate_1])
VAR CNY_Rate_1 = MAXX(FILTER('slicertable', slicertable[Curreny] = "cny"), 'slicertable'[rate_1])

RETURN
SUMX(
    CurrencyAmounts,
    SWITCH(
        facttable[Curreny],
        "usd", 'Facttable'[Amount] * USD_Rate_1,
        "eur", 'Facttable'[Amount] * EUR_Rate_1,
        "cny", 'Facttable'[Amount] * CNY_Rate_1
    )
)

 

 

 

 

 

3 REPLIES 3
Anonymous
Not applicable

Hi,
the code below also works for me but when i try to enter the filter argument, seems it is not doing the multiplication properly. 
SUMX(facttable,
            factable[Amount]*RELATED(_slicertable[RateCol1])) 

Anonymous
Not applicable

Hi, @Anonymous 

In another post based on the data you provided:

vjianpengmsft_0-1709026647553.png

vjianpengmsft_1-1709026667278.png

I tested adding filter conditions in summarize

vjianpengmsft_2-1709026825593.png

After I added the condition it worked fine:

vjianpengmsft_3-1709026906287.png

vjianpengmsft_4-1709027006500.png

Additionally, I created a measure based on the DAX you provided which correctly returns the result of the multiplication:

vjianpengmsft_5-1709027184182.png

 

Can you describe in detail what you are unable to do by adding the filter argument? 

 

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Jonvoge
Super User
Super User

Hi Setosa.

 

What is the unexpected result? Consider uploading some screenshots or a sample .pbix, along with your expected result, for better help.

_____________________________________________________
I hope my comment was helpful.
If your question was answered, please mark your post as 'Solved' and consider giving me a 'Thumbs Up'.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors