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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors