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
Anonymous
Not applicable

Second filter that would be between month beginning and ending

have the following code, which sums up all my fees for my clients.

 

SumAmtVar = SUMX ( FILTER ( _billings, _billings[_tsg_clientid_value] = accounts[accountid] ), __billings[Amount] )

 

What I am needing is an additional filter that filters my transaction dates for the current month or a hard coded date range. What would the second filter look like? Any help or assistance is greatly appreciated.

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

Isn't MONTH ( _billings[Date] ) = MONTH ( TODAY () ) the August 1, 2018 to August 31, 2018? If you want a more dynamic method, it could be like below.

SumAmtVar =
CALCULATE (
    SUMX (
        FILTER ( _billings, _billings[_tsg_clientid_value] = accounts[accountid] ),
        __billings[Amount]
    ),
    FILTER (
        _billings,
        _billings[Date] >= DATE ( 2018, 8, 1 )
            && _billings[Date] <= DATE ( 2018, 8, 31 )
    )
)

 

Best Regards,

Dale

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

View solution in original post

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

How does your data look like? It could be like below.

SumAmtVar =
SUMX (
    FILTER (
        _billings,
        _billings[_tsg_clientid_value] = accounts[accountid]
            && MONTH ( _billings[Date] ) = MONTH ( TODAY () )
    ),
    __billings[Amount]
)

or

SumAmtVar =
CALCULATE (
    SUMX (
        FILTER ( _billings, _billings[_tsg_clientid_value] = accounts[accountid] ),
        __billings[Amount]
    ),
    FILTER ( _billings, MONTH ( _billings[Date] ) = MONTH ( TODAY () ) )
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I am looking to do a filter between dates, for example August.  I need a filter the _billings[Date] as August 1, 2018 through August 31, 2018.  How do I ceate a between date range filter?

Hi @Anonymous,

 

Isn't MONTH ( _billings[Date] ) = MONTH ( TODAY () ) the August 1, 2018 to August 31, 2018? If you want a more dynamic method, it could be like below.

SumAmtVar =
CALCULATE (
    SUMX (
        FILTER ( _billings, _billings[_tsg_clientid_value] = accounts[accountid] ),
        __billings[Amount]
    ),
    FILTER (
        _billings,
        _billings[Date] >= DATE ( 2018, 8, 1 )
            && _billings[Date] <= DATE ( 2018, 8, 31 )
    )
)

 

Best Regards,

Dale

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

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.