cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Senrsi
Frequent Visitor

Row % with total part of a rolling total

Hey i am just started working with Power BI and i am trying to get a precentage of a row total for a coulumn group that is looking at a time frame.  I had no issues getting this to work for a single month but when i try to replicate this with a timeframe i am hitting a wall.

 

I am usining the DAX code:

Rolling % =
DIVIDE(
CALCULATE(
SUM(MarketShare[Revenue]),FILTER(ALL(MarketShare[Date]),MarketShare[Date] <= MAX(MarketShare[Date]) && MarketShare[Date] >= MAX(MarketShare[Date])-365)),
CALCULATE(
SUM(MarketShare[Revenue]),FILTER(ALL(MarketShare[Date]),MarketShare[Date] <= MAX(MarketShare[Date]) && MarketShare[Date] >= MAX(MarketShare[Date])-365),
ALL(MarketShare[Competitor])
))
 
But the results is returning 100%.  Is there something that i am missing?
 
Current View          
LOCATIONC1C2C3C4C5Total     
L1100050025050010003250     
L2130010005007509004450     
L38008507006009003850     
            
Wanted View          
LOCATIONC1 C2 C3 C4 C5 Total
L11000.0030.8%500.0015.4%250.007.7%500.0015.4%1000.0030.8%3250.00
L21300.0040.0%1000.0030.8%500.0015.4%750.0023.1%900.0027.7%4450.00
L3800.0024.6%850.0026.2%700.0021.5%600.0018.5%900.0027.7%3850.00
4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @Senrsi ,

 

Has your problem been solved?

 

Best regards,
Lionel Chen

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

Ashish_Mathur
Super User III
Super User III

Hi,

In the image that you have shared, there is no mention of any time frame/slicer.  Share the download link of your PBI file where one can clearly see the problem for a slicer selection.  Please also show your expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-lionel-msft
Community Support
Community Support

Hi @Senrsi ,

 

Is this what you want?

v-lionel-msft_0-1621562374385.png

 

Best regards,
Lionel Chen

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

Lionel Chen

 

Sorry for the delayed respones.  Your solution does work for me for a single month but the issue i am having is that it is a rolling time frame that is looking back 3 months.  I tried posing my power bi File to show but for some reason i am having issues with my Posting attachments.

To compare it to what you provided my table has four coulmns Location, Date, Attribute, Value

Regards

 

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Top Kudoed Authors