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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
pbrainard
Helper III
Helper III

Filter Date by Slicer Selection

I have a slicer for fiscal quarters... Q1 Q2 Q3 Q4

 

This calculated table helps me find the min and max dates for a compare. How do I edit this table query to be able to have the End Date determined by the quarter selected in the slicer?

 

CalcTablePHQGAD =
ADDCOLUMNS (
ADDCOLUMNS (
SUMMARIZE ( MHGAD_PHQ, MHGAD_PHQ[Client_ID], MHGAD_PHQ[Assess_Type] ),
"Start Date", CALCULATE ( MIN ( MHGAD_PHQ[Assess_Date] ) ),
"End Date", CALCULATE ( MAX ( MHGAD_PHQ[Assess_Date] ) )
),
"Start Score",
VAR _current_asset_type = MHGAD_PHQ[Assess_Type]
VAR _current_start_date = [Start Date]
RETURN
CALCULATE (
AVERAGE ( MHGAD_PHQ[Assess_Score] ),
MHGAD_PHQ[Assess_Date] = _current_start_date,
MHGAD_PHQ[Assess_Type] = _current_asset_type
),
"End Score",
VAR _current_asset_type = MHGAD_PHQ[Assess_Type]
VAR _current_end_date = [End Date]
RETURN
CALCULATE (
AVERAGE ( MHGAD_PHQ[Assess_Score] ),
MHGAD_PHQ[Assess_Date] = _current_end_date,
MHGAD_PHQ[Assess_Type] = _current_asset_type
),
    "Dates Okay",
        IF (
            [End Date] > [Start Date],
            "Yes",
            "No"
            )
)
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello

 

It is much more easier to have a Table Date with all the columns you want

eg

JamesFr06_0-1653759019430.png

 

View solution in original post

3 REPLIES 3
Fowmy
Super User
Super User

@pbrainard 


Calculated tables are created at the data model level, and they are used in your report canves. Any slicer you apply to the canves will not affect the calculated tables. 
Consider creating a measure to use the selection from the slicer.  


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

I think that's where I'm stuck. How would I create such a measure? I'm guessing I want to incorporate the SELECTEDVALUE on this line...?

"End Date"CALCULATE ( MAX ( MHGAD_PHQ[Assess_Date] ) )

 

I do have the calc table connected to a calendar table and trying to have my 'End Date' be the max date of the quarter selected, so it ignores dates that are greater than the selected quarter.

Anonymous
Not applicable

Hello

 

It is much more easier to have a Table Date with all the columns you want

eg

JamesFr06_0-1653759019430.png

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.