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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
rrjr007
Frequent Visitor

Using a table to show share by time period, yoy, and customer(s)

Greetings everyone.  I'm trying to use a table to do the following:

1 - show share for a time period(s)

2 - compare the share for two time periods, and visually show if it is up, down, or flat

3-  compare the share for two time periods, and visually show if it is up, down, or flat, this time adding customers into the mix

 

For question 1, When I use the 100% stacked column chart or the matrix, I get the percentage share I want (see below).  However I cannot figure out how to get this view in a table.

rrjr007_0-1598971933938.pngrrjr007_1-1598972739981.png

Below is a sample of my data.  I'm sure this is a series of measure I'll need to do, I just cannot figure it out.  Thank you.

 

rrjr007_2-1598973116873.png

 

 

 

 

6 REPLIES 6
bhagyashripatil
Advocate I
Advocate I

Hello @rrjr007 ,

 

Please find below the DAX you need to create to get aggregated % values for the Yearly measure values, which you are referring to.

 

1) Yearly_Total = CALCULATE( SUM( Table[measure] ), ALLEXCEPT( Table, Table[Date].[Year] ) )
2) %Yearly_Total = SUM( Table[measure] ) / [Yearly_Total]
 
Also attaching the screenshot for reference.
Note: I have tried this on other sample data.
 
Sample.PNG
If I answer your question, please mark my post as solution, this will also help others.

@bhagyashripatil  I tried the reccomended formula:

Yearly_Total = CALCULATE(SUM( Data[Std Cnt]), ALLEXCEPT(Data,Data[Fiscal YTD].[2013]))
 
I received the error below.  Thoughts?  Thanks.

 

rrjr007_0-1598979237321.png

 

Hello @rrjr007 ,

 

A slight change needed in your DAX, which is as follows:

Yearly_Total = CALCULATE(SUM( Data[Std Cnt]), ALLEXCEPT(Data,Data[Fiscal YTD].[2013]))

Please remove the part highlighted in RED in above DAX

 

Your Updated DAX : Yearly_Total = CALCULATE( SUM( Data[Std Cnt] ), ALLEXCEPT( Data,Data[Fiscal YTD] ) )

This sould solve your error.

 

For your information:

We dont pass the year value after referring the Year column "Data[Fiscal YTD].[2013]" , that we do in case of Date.

If you refer a Date column, that is where you need to give granularity of Year/Qtr/Month/Date etc. like -> Data[Fiscal Date].[Year]

 

If I answer your question, please mark my post as solution, this will also help others.

For the longest time, I was not getting this to work.  There were a few reasons.  The biggest one was a slicer.   Using your data as an example, I had Office Supplies de seleted in my slicer.  So, my totals were not matching.  Once i cleared the slicer, my totals and percentages are working perfectly.

 

The issue with the slicer, is leading me to a followup/new question.  How do I get the data to reflect the numbers when a slicer filters out a group - for example Office Supplies is deselected?

 

Thanks in advance.

@rrjr007 - Not sure if you are still having an issue, but if you are and the problem is with a total line when you have a slicer selected (I *think* that is what you said) then you may have a measures total problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@rrjr007 , Not very clear

In a Matrix - put Axis of stacked on Row and legend on the column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.