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.
I have the following table:
I can display a Matrix in PowerBI with the count per week/year, that generates something like:
You can see that the weeks for each year are not totaling based on previous weeks results. As an example week 2 for 2018 should show 12.
This works with my slicers, but now I need to add a line chart that cumulates the totals to show sales growth per year. I have searched the forum and can't seem to find the solution. Thoughts?
Solved! Go to Solution.
Hello @justinmpalmer ,
In my opinion, you want to accumulate the count based on the number of weeks each year, don't you?
You can use the following formula:
Measure =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
'Table'[Sales period] = MAX ( 'Table'[Sales period] )
&& 'Table'[Created on Week Number] <= MAX ( 'Table'[Created on Week Number] )
)
)
My visualization looks like this:
Have I answered your question? Please mark my answer as a solution. Thanks a lot.
If not, load some insensitive data samples and expected output.
Best regards
Eyelyn Qin
Hi @justinmpalmer ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Eyelyn Qin
Hello @justinmpalmer ,
In my opinion, you want to accumulate the count based on the number of weeks each year, don't you?
You can use the following formula:
Measure =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
'Table'[Sales period] = MAX ( 'Table'[Sales period] )
&& 'Table'[Created on Week Number] <= MAX ( 'Table'[Created on Week Number] )
)
)
My visualization looks like this:
Have I answered your question? Please mark my answer as a solution. Thanks a lot.
If not, load some insensitive data samples and expected output.
Best regards
Eyelyn Qin
@justinmpalmer , Assume you already have measure and sales_period is year
CALCUALTE([measure], filter(allselected(Table), Table[Created on Week Number] <= max(Table[Created on Week Number]) && Table[_sales_period] =max(Table[_sales_period] )))
or
CALCUALTE(countrows(Table) , filter(allselected(Table), Table[Created on Week Number] <= max(Table[Created on Week Number]) && Table[_sales_period] =max(Table[_sales_period] )))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |