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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors