Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello Colleagues,
I have a very weird problem. I have an Avg Price YTD and Avg Price YTD with some conditions and same DAX. The Avg Price YTD is giving me accurate answer and LYTD is giving me inconsistent answer. Below is the screenshot.
Here the "220152" is item no and below is the customer. As you can see 'cross' marked are wrong values and at higher item level hierarchy the value is always wrong, but when we drill down we have right and wrong answers. Below are the DAX for YTD and LYTD
Hi @sandeep_me,
According to your description, it seems that the measure [Average Price_LYTD_Cust/Item] does not get the correct value, either in the total or in each sub-level section. Are the values of [Sales YTD], [Sales LYTD], [Sales QTY YTD] [Sales QTY LYTD] and [Average Price_YTD_Cust/Item] referenced by this measure all correct? Please create a new measure based on [Average Price_LYTD_Cust/Item] as follows:
Measure =
SUMX (
GROUPBY ( 'fact_CustInvoice', [Product Category], [Product], [Item] ), //The fields which be put on Rows options of matrix visual
[Average Price_LYTD_Cust/Item]
)
You can also refer the following threads to resolve it:
Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand
Dax for Power BI: Fixing Incorrect Measure Totals
If the above ones can't help you get the correct results, please share a simplified pbix file(exclude sensitive data) with us in order to provide you a suitable solution. Thank you.
Best Regards
@amitchandak : Avg Price is with a condition as you can see. [Sales YTD] and [Sales LYTD] is already a calculated measure. Below is the DAX
@sandeep_me , Not very clear.
Is avg price like
Avg Price = Divide( Sum(sales[sales]) , Sum(sales[Qty]) )
then try
YTD Sales = CALCULATE([Avg Price],DATESYTD('Date'[Date],"12/31"))
Last YTD = CALCULATE([Avg Price],DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
87 | |
84 | |
68 | |
64 | |
63 |
User | Count |
---|---|
208 | |
120 | |
113 | |
79 | |
72 |