Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi I am trying to check how many product have been delivered day on day basis in cumulative order i.e. my graph would be in upward trend. So if on day 1 I have delivered 50 product and on day 2 I have delivered 31 product so on day 2 it should say 81 product.
New Daily Volume = CALCULATE( SUM(product[product_delivered]), FILTER( ALLSELECTED('product'), 'product'[product_deliver_date] <= MAX('product'[product_deliver_date]) ) )
I have created a new measure using above query and the above query works if there is only 1month selected in my Power BI chart. However if I select another month the line chart is not displaying correct result. For eg: Initially if I select 2023-10 and on 31st Oct, 2023 total product deliver would be 10000. Then upon selecting next month i.e. 2023-11 on 1st day if I deliver 122 product then it is showing 10122 and not 122 (shown in the below example).
However the correct representation would be below chart
Below image represent the number how it should be represent and how it is represented(Refer 2023-11(Incorrect)) column which is incorrect however I want data to be represented as column 2023-10(Correct) , 2023-11(Correct)
Sample Raw Data
product_deliver_date | updated_month | product_delivered | dayofthemonth |
11/1/2023 | 2023-11 | 1 | 1 |
11/1/2023 | 2023-11 | 1 | 1 |
11/2/2023 | 2023-11 | 1 | 2 |
11/2/2023 | 2023-11 | 1 | 2 |
11/2/2023 | 2023-11 | 1 | 2 |
11/2/2023 | 2023-11 | 1 | 2 |
10/3/2023 | 2023-10 | 1 | 3 |
10/3/2023 | 2023-10 | 1 | 3 |
11/3/2023 | 2023-11 | 1 | 3 |
11/3/2023 | 2023-11 | 1 | 3 |
11/3/2023 | 2023-11 | 1 | 3 |
11/4/2023 | 2023-11 | 1 | 4 |
11/4/2023 | 2023-11 | 1 | 4 |
11/4/2023 | 2023-11 | 1 | 4 |
11/4/2023 | 2023-11 | 1 | 4 |
10/4/2023 | 2023-10 | 1 | 4 |
10/4/2023 | 2023-10 | 1 | 4 |
10/4/2023 | 2023-10 | 1 | 4 |
11/3/2023 | 2023-10 | 1 | 3 |
Can someone help me with this please? I am just starting to learn Power BI so kindly let me know how to resolve this? Any help would be appreciated.
Solved! Go to Solution.
Hi @Anonomous_user ,
I create a table as you mentioned.
It looks like you are trying to create a cumulative total measure in Power BI that resets at the start of each month. The issue you are encountering is due to the ALLSELECTED function, which does not reset the cumulative total when a new month is selected.
I think you can use REMOVEFILTERS to remove the filter context from the updated_month column, allowing the cumulative total to reset each month.
Cumulative Product Delivered =
CALCULATE (
SUM ( product[product_delivered] ),
FILTER (
ALL ( 'product'[product_deliver_date] ),
'product'[product_deliver_date] <= MAX ( 'product'[product_deliver_date] )
),
REMOVEFILTERS ( 'product'[updated_month] )
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonomous_user ,
I create a table as you mentioned.
It looks like you are trying to create a cumulative total measure in Power BI that resets at the start of each month. The issue you are encountering is due to the ALLSELECTED function, which does not reset the cumulative total when a new month is selected.
I think you can use REMOVEFILTERS to remove the filter context from the updated_month column, allowing the cumulative total to reset each month.
Cumulative Product Delivered =
CALCULATE (
SUM ( product[product_delivered] ),
FILTER (
ALL ( 'product'[product_deliver_date] ),
'product'[product_deliver_date] <= MAX ( 'product'[product_deliver_date] )
),
REMOVEFILTERS ( 'product'[updated_month] )
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Everyone,
Can anyone help me on this issue I have been stuck from past 2 days on this. Little bit urgent from my end. Any help would be aprreciated.
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
114 | |
97 | |
95 | |
68 | |
65 |