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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
admin11
Memorable Member
Memorable Member

How to insert condition into my _YTD_EXP_ expression ?

Hi All

I have below expression working fine.

_YTD_EXP_ = CALCULATE(CALCULATE(GL[AMOUNT_EXP_],DATESYTD('Date'[Date],"12/31")))
Above expression will display all expense.
 
i also i have below expression working fine , it can filter only expense for salary :-it is a column. the filter name is 1_EXP_SALARY
 
May i know how to insert 1_EXP_SALARY Into _YTD_EXP_ ?
 
My PBI sample file :-
 
Paul
 
1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @admin11 

Sorry, I don't quite understand what you mean. In your pbix, the 1_EXP_SALARY slicer can filter _YTD_EXP_ normally. Why do you still need to insert condition into my _YTD_EXP_ expression?

Maybe you can try formula as below:

_YTD_EXP_1 =
CALCULATE (
    SUM ( GL[AMT] ) * 1,
    FILTER ( GL, GL[1_EXP] = "EXP" ),
    DATESYTD ( 'Date'[Date], "12/31" ),
    FILTER ( GL, GL[1_EXP_SALARY] = "Yes" )
)

Best Regards,
Community Support Team _ Eason

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @admin11 

Sorry, I don't quite understand what you mean. In your pbix, the 1_EXP_SALARY slicer can filter _YTD_EXP_ normally. Why do you still need to insert condition into my _YTD_EXP_ expression?

Maybe you can try formula as below:

_YTD_EXP_1 =
CALCULATE (
    SUM ( GL[AMT] ) * 1,
    FILTER ( GL, GL[1_EXP] = "EXP" ),
    DATESYTD ( 'Date'[Date], "12/31" ),
    FILTER ( GL, GL[1_EXP_SALARY] = "Yes" )
)

Best Regards,
Community Support Team _ Eason

@v-easonf-msft 

Thank you very much it work fine now.

 

Paul

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.