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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.