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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Current and Previous Period Columns based on Slicer selection -&- Remove Subtotals from Text Columns

I created some sample data (files linked below) of something I could use some help on. I would like to create a "Current Period" column, "Previous Period" column, and a "Difference" column. I'd also like a dropdown slicer to filter specifically on year, quarter, or month, and have the "Previous Period" column update accordingly based on the slicer selection. 

 

Furthermore, how do I prevent subtotals from appearing on text columns? As you can see in the screenshot below, I'm getting a text total of "1111" and "Atlanta", but the amount column totals correctly.

 

Screenshot.png

 

.pbix and .xlsx can be found at: Google Drive Link 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Two method:

 

Method 1: Create measures for text columns.

CostCenter Measure =
IF (
    ISFILTERED ( 'Employee Expenses'[CCOwnerVP] ),
    MAX ( 'Employee Expenses'[CostCenter] )
)
CostCenterDescription Measure =
IF (
    ISFILTERED ( 'Employee Expenses'[CCOwnerVP] ),
    MAX ( 'Employee Expenses'[CostCenterDescription] )
)
Date Measure =
IF (
    ISFILTERED ( 'Employee Expenses'[CCOwnerVP] ),
    MAX ( 'Employee Expenses'[Date] )
)

 

Then replace your text columns with the measures above.

measure.JPG

 

 

Method 2: use buttons to cover the subtotals not needed.

cover.gif

 

BTW, .pbix file attached.

 

 

 

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Two method:

 

Method 1: Create measures for text columns.

CostCenter Measure =
IF (
    ISFILTERED ( 'Employee Expenses'[CCOwnerVP] ),
    MAX ( 'Employee Expenses'[CostCenter] )
)
CostCenterDescription Measure =
IF (
    ISFILTERED ( 'Employee Expenses'[CCOwnerVP] ),
    MAX ( 'Employee Expenses'[CostCenterDescription] )
)
Date Measure =
IF (
    ISFILTERED ( 'Employee Expenses'[CCOwnerVP] ),
    MAX ( 'Employee Expenses'[Date] )
)

 

Then replace your text columns with the measures above.

measure.JPG

 

 

Method 2: use buttons to cover the subtotals not needed.

cover.gif

 

BTW, .pbix file attached.

 

 

 

Anonymous
Not applicable

Thank you so much for the help @Icey !

Anonymous
Not applicable

I updated my .pbix file on Google Drive as I realized my slicer needed to be on a Calendar Table with continuous dates. I also created two measures, shown below.

Previous Period = CALCULATE(
SUM('Employee Expenses'[Amount]),
SAMEPERIODLASTYEAR(CalendarTbl[Date]))
 
Difference = CALCULATE(Sum('Employee Expenses'[Amount])-[Previous Period])
 
I still have not figured out how to remove subtotals from text columns.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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