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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.