Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
As the title says I want to filter in some way the sales of the previous month that I get with this formula:
I am using as an example only one day I leave you a test pbix that I put together to try to perform the measurement.
They helped me with a measure but the total is adding another value:
Measure = SUMX(FILTER(VALUES('data tests'[DISTRIBUTOR]),[Advance]>0),[LM Advance <])
I work well at the level records this formula but to show every day is not correctly adding the value, I was thinking of using a hasonevalue but it would not be the solution since this measure will be used in many ways and you would have to create many hasonvalue :
PBix :
https://we.tl/t-yt3K2nJCNz
Solved! Go to Solution.
Try combining your measurements :
Now I will try it on the original pbix.
@Epuma Thanks for starting another post - your other message was getting busy I guess so some replies have been lost in the thread! (ref to your other post for benefit of other users: https://community.powerbi.com/t5/Desktop/Get-previous-month-s-sales-of-products-that-have-sales-on-t...)
How do you define 'Period'? Your question is all about the DAX Context you provide to your measure. You need to provide the context of the period, but you're providing the context of the Distribuidor. You need to use Calendario in your SUMX. You do not need to use VALUES(distribuidor).
Please see both pages of my update of your file, and also these measures:
(so use the Calendario table as the context for your SUMX measure):
AK Avance LM < DAILY = SUMX(Calendario, IF([Avance] <> BLANK(), CALCULATE([Avance], DATEADD(Calendario[Date], -1 , MONTH))))
Using Month, Year as the Period
I have used the VALUES(Calendario[Ano Mes]) column as the context for SUMX measure, but you could use Calendario[Periodo] with the same result:
AK Avance LM < MONTHLY =
SUMX(VALUES(Calendario[Año Mes]), CALCULATE([Avance], DATEADD(Calendario[Date], -1, MONTH)))
Check both pages of your attached report (see below signature). Pagina 1 is filtered for 2021-9 Periodo and Duplicate of Pagina 1 has no filter for Period.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Thank you very much for replying, but I need the total to show the sum of the results in Avance LM < v2 :
The correct total is: 1066152
Try combining your measurements :
Now I will try it on the original pbix.
User | Count |
---|---|
93 | |
84 | |
78 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
60 |