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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Ania26
Helper II
Helper II

Show sum per category and do not change it with filter

Hello, I want to have table that shows TTL Number of Packs per Year and Quarter and Destination Market.

So for Example for Australia it is 5 in Q2 and 7 in Q4.

 

Then when I filter by Market Variant I still want to see Destination Market Australia with all quarters and total values 5 and 7.

This will be only used in Excel, with Analyse in Excel function. So I need to create measure that works in Excel.

 

Thank you.

Please help.

 

Thank you,

 

Anna

Destination MarketYearQuarterMarket VariantTTL Number of Packs per Destination Market
AUSTRALIA2022Q2PHILIPPINES5
AUSTRALIA2022Q2DUTY FREE5
AUSTRALIA2022Q2DUTY FREE5
AUSTRALIA2022Q2PHILIPPINES5
AUSTRALIA2022Q2KOREA5
AUSTRALIA2022Q4JAPAN7
AUSTRALIA2022Q4JAPAN7
AUSTRALIA2022Q4KAZAKHSTAN7
AUSTRALIA2022Q4DUTY FREE7
AUSTRALIA2022Q4PHILIPPINES7
AUSTRALIA2022Q4KOREA7
AUSTRALIA2022Q4PHILIPPINES7

Ania26_0-1723093143572.png

 

1 ACCEPTED SOLUTION
v-jialongy-msft
Community Support
Community Support

Hi @Ania26 

Please try the following measure:

Measure = 
VAR _selectyear = SELECTEDVALUE('Table'[Year])
VAR _selectquarter = SELECTEDVALUE('Table'[Quarter])
RETURN
CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Year] = _selectyear && 'Table'[Quarter] = _selectquarter))


Result:

vjialongymsft_0-1723532435303.png

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Thejeswar
Super User
Super User

Hi @Ania26 ,

Just removing the duplicates in your dataset will fix this. and show 5 and 7 respectively for Q2 2022 and Q4 2022 for Australia for any market filter applied.

 Set the Aggregation of TTL Number of packs to Maximum as shown below. This will show 5 and 7 as you requested, even when multiple market variant filters are applied. 

Thejeswar_0-1723533702498.png

Setting this aggregation to sum will sum the TTL Number for each market variant selected. Refer below ss

Thejeswar_1-1723533839508.png

 

Regards,

 

Hello, This will be used in Excel so it has be be straightforward calculation for everyone who can do basic Pivot Table analysis. Thank you for your effort.

@Ania26 ,

Got it.

Create a measure as shown below

Max_TTL = CALCULATE(MAX('Table'[TTL Number of Packs per Destination Market]))

 

This you can access directly from excel using Analyze in excel. But I doubt you can do anything at the DAX level to ignore the Market Unit filter that will be applied in excel.

 

Just like how there is edit interaction in Power BI, you might have to find a way to ignore the filters applied on market unit from within excel.

 

Regards,

v-jialongy-msft
Community Support
Community Support

Hi @Ania26 

Please try the following measure:

Measure = 
VAR _selectyear = SELECTEDVALUE('Table'[Year])
VAR _selectquarter = SELECTEDVALUE('Table'[Quarter])
RETURN
CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Year] = _selectyear && 'Table'[Quarter] = _selectquarter))


Result:

vjialongymsft_0-1723532435303.png

 

 

 

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello, when I select Market Variant Kazakhstan, I still see only Q4:

 

Ania26_0-1723540690858.png

Thank you for your help. 

Ania26
Helper II
Helper II

Hello, thank you for your response. I forgot to add, that this will be only used in Excel, with Analyse in Excel function. So I need to create measure that works in Excel.

 

Thank you.

miTutorials
Super User
Super User

Go to Format Tab and click on Edit Interactions, select the filter and on the table select no nothing.. See the video below.

 

How to Make a Slicer not affect all the Visuals in PowerBI | Edit Interactions | MI Tutorials (youtu...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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