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.
Hi All,
Our data set has a product category, trying to show product sales at YTD when month slicer is selected.
Suppose we select September month the product sales should show YTD sales from January to September. True for any selected month.
That I have achieved using the following DAX
YTD Sales = VAR lastDay = MAX ( A2[ORDER_RECEIVED_DATE] ) VAR year = YEAR ( lastDay ) RETURN CALCULATE ( SUM ( A2[Sales] ), FILTER ( ALLEXCEPT(A2 ,A2[Product] ), YEAR ( A2[ORDER_RECEIVED_DATE]) = year && A2[ORDER_RECEIVED_DATE] <= lastDay ) )
Using it able to see YTD sales for selected month slicer.
But when we select month suppose say September in the slicer selection, the products are filtered for the September month and only products present in the month are showing up in the view. But then I need to see all the products present in the data set not the products in the select slice.
Note I am using direct query connection, so I cannot use the full capability of DAX
Thank You,
As shown above, the data has three products, but march month has only one product a.
even if we select march month, the view should show all the products and its relevant YTD sales value.
Please help me with a solution.
Sample pbix file: https://www.dropbox.com/s/4l19pn8qy8nf0hn/Sample%20YTD.pbix?dl=0
Hi @anil,
Could you please post your desired result if possible?
Regards,
Daniel He
@v-danhe-msft Thanks for the reply,
If we select March slicer. The result should display for all the products:
Products YTD Sales
a 2702352
b 3781456
c 2402070
The month slicer should not filter products, even though b and c products are not present in March month. Should fetch the YTD sales results for all the products.
Any solution for this problem?
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |