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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Jason_Walker
Frequent Visitor

Trouble Combining Two Filters

I have a table with sales obligations over the current fiscal year (starting in October) that I want to compare to a couple other tables with prior fiscal year data. I finally got the fiscal months to show cumulative results AND to be in chronological order using the measure below:

 

 

 

 

Cumulative Obs =

VAR CurrentMonth = MAX('Fiscal Month'[Fiscal Month])

RETURN

CALCULATE(

SUM('FY24 Execution'[Oblig.]),

FILTER(

ALL('Fiscal Month'),

'Fiscal Month'[Fiscal Month] <= CurrentMonth

)

)

 

Now I would like to hide/delete any future fiscal month data for the current fiscal year in the visual so the data looks cleaner. Currently, the visual looks like this:

 

Hide Future Months.JPG

 

I created a custom column [DatesWithObligations] in Power Query to check whether the [Posting Date] from my table is <= the current date.

 

= Table.AddColumn(#"Renamed Columns2", "DatesWithObligations", each [Posting date] <= DateTime.Date(DateTime.LocalNow()))

 

Lastly, I tried to add a filter to the measure from above that would remove any future fiscal months using [DatesWithObligations].

 

Cumulative Obs =

VAR CurrentMonth = MAX('Fiscal Month'[Fiscal Month])

RETURN

CALCULATE(

SUM('FY24 Execution'[Oblig.]),

FILTER('FY24 Execution','FY24 Execution''[DatesWithObligations] = "TRUE"),

 

FILTER(

ALL('Fiscal Month'),

'Fiscal Month'[Fiscal Month] <= CurrentMonth)

)

 

The measure above gives the same results with future fiscal months still showing as a straight line. I'm sure I have the syntax of the measure messed up but I can't figure out how to both aggregate obligations by fiscal month and remove future fiscal month obligations.

 

Any ideas?

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Maybe you can check to see if any dates in the current month have obligations and condition the result on that. Something like this:

Cumulative Obs =
VAR CurrentMonth = MAX ( 'Fiscal Month'[Fiscal Month] )
VAR IsValidMonth = MAX ( 'FY24 Execution'[DatesWithObligations] )
RETURN
    IF (
        IsValidMonth,
        CALCULATE (
            SUM ( 'FY24 Execution'[Oblig.] ),
            FILTER (
                ALL ( 'Fiscal Month' ),
                'Fiscal Month'[Fiscal Month] <= CurrentMonth
            )
        )
    )

(This implicitly returns blank if IsValidMonth is false.)

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

Maybe you can check to see if any dates in the current month have obligations and condition the result on that. Something like this:

Cumulative Obs =
VAR CurrentMonth = MAX ( 'Fiscal Month'[Fiscal Month] )
VAR IsValidMonth = MAX ( 'FY24 Execution'[DatesWithObligations] )
RETURN
    IF (
        IsValidMonth,
        CALCULATE (
            SUM ( 'FY24 Execution'[Oblig.] ),
            FILTER (
                ALL ( 'Fiscal Month' ),
                'Fiscal Month'[Fiscal Month] <= CurrentMonth
            )
        )
    )

(This implicitly returns blank if IsValidMonth is false.)

Ya da man! Thanks, that worked perfect.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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