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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
ANAC014
Frequent Visitor

Table visual with different filters for each column (slicer interaction involved)

Hello dear community! please I need your support.

 

I have the following table

Sales PersonAmountWeekQuarter
Anna1025Q2
Peter2025Q2
Mary3025Q2
Anna4026Q2
Peter5026Q2
Mary6026Q2
Anna7027Q3
Peter8027Q3
Mary9027Q3
Anna10028Q3
Peter11028Q3
Mary12028Q3

 

Then, I need to create following table with following info:

Sales PersonWeek This Quarter (Q3)Previous Quarter (Q2)
Anna1017050
Peter2021090
Mary3019070

 

The problem is that I have a slicer for Week, so the colum week is filtered ok with the slicer... but the other two colums, which should sum al the values corresponding to this quarter or previous quarter doesnt work because the slicer.

 

Could you please give me a hand?

 

@Anonymous 

 

1 ACCEPTED SOLUTION
sturlaws
Resident Rockstar
Resident Rockstar

Hi,

 

based on your sample data, you could do this:

Current quater =
VAR _cq =
    CALCULATE ( MAX ( 'Table'[QuaterNo] ); ALL ( 'Table' ) )
RETURN
    CALCULATE (
        SUM ( 'Table'[Amount] );
        FILTER ( ALLEXCEPT ( 'Table'; 'Table'[Sales Person] ); 'Table'[QuaterNo] = _cq )
    )
Previous quater =
VAR _cq =
    CALCULATE ( MAX ( 'Table'[QuaterNo] ); ALL ( 'Table' ) ) - 1
RETURN
    CALCULATE (
        SUM ( 'Table'[Amount] );
        FILTER ( ALLEXCEPT ( 'Table'; 'Table'[Sales Person] ); 'Table'[QuaterNo] = _cq )
    )


The idea is to find the last quater of you dataset, and then remove all filters except the filters on sales person. I guess your sample dataset is a bit simplified. I guess you have date table in your report/model, so you can make use of the TODAY()-function to identify the current quater. If your data spans several year, you can create a quaterYearNum-column like this ([year]-2010)*4+quaterNumber(2010 is chosen somewhat arbitrarily). This will give you a sequence of quaters, and the previous quater can be refererenced by curretn quaterYearNum-1. In order to get quater number from a date, you can use the format-function: FORMAT(date,"Q").

 

cheers,

s
 

 

View solution in original post

2 REPLIES 2
sturlaws
Resident Rockstar
Resident Rockstar

Hi,

 

based on your sample data, you could do this:

Current quater =
VAR _cq =
    CALCULATE ( MAX ( 'Table'[QuaterNo] ); ALL ( 'Table' ) )
RETURN
    CALCULATE (
        SUM ( 'Table'[Amount] );
        FILTER ( ALLEXCEPT ( 'Table'; 'Table'[Sales Person] ); 'Table'[QuaterNo] = _cq )
    )
Previous quater =
VAR _cq =
    CALCULATE ( MAX ( 'Table'[QuaterNo] ); ALL ( 'Table' ) ) - 1
RETURN
    CALCULATE (
        SUM ( 'Table'[Amount] );
        FILTER ( ALLEXCEPT ( 'Table'; 'Table'[Sales Person] ); 'Table'[QuaterNo] = _cq )
    )


The idea is to find the last quater of you dataset, and then remove all filters except the filters on sales person. I guess your sample dataset is a bit simplified. I guess you have date table in your report/model, so you can make use of the TODAY()-function to identify the current quater. If your data spans several year, you can create a quaterYearNum-column like this ([year]-2010)*4+quaterNumber(2010 is chosen somewhat arbitrarily). This will give you a sequence of quaters, and the previous quater can be refererenced by curretn quaterYearNum-1. In order to get quater number from a date, you can use the format-function: FORMAT(date,"Q").

 

cheers,

s
 

 

Works perfectly my friend, thanks so much!



@sturlaws wrote:

Hi,

 

based on your sample data, you could do this:

Current quater =
VAR _cq =
    CALCULATE ( MAX ( 'Table'[QuaterNo] ); ALL ( 'Table' ) )
RETURN
    CALCULATE (
        SUM ( 'Table'[Amount] );
        FILTER ( ALLEXCEPT ( 'Table'; 'Table'[Sales Person] ); 'Table'[QuaterNo] = _cq )
    )
Previous quater =
VAR _cq =
    CALCULATE ( MAX ( 'Table'[QuaterNo] ); ALL ( 'Table' ) ) - 1
RETURN
    CALCULATE (
        SUM ( 'Table'[Amount] );
        FILTER ( ALLEXCEPT ( 'Table'; 'Table'[Sales Person] ); 'Table'[QuaterNo] = _cq )
    )


The idea is to find the last quater of you dataset, and then remove all filters except the filters on sales person. I guess your sample dataset is a bit simplified. I guess you have date table in your report/model, so you can make use of the TODAY()-function to identify the current quater. If your data spans several year, you can create a quaterYearNum-column like this ([year]-2010)*4+quaterNumber(2010 is chosen somewhat arbitrarily). This will give you a sequence of quaters, and the previous quater can be refererenced by curretn quaterYearNum-1. In order to get quater number from a date, you can use the format-function: FORMAT(date,"Q").

 

cheers,

s
 

 


 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors