Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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] )))