Forum Discussion
Variations on December
- 1 year ago
Thank you for reaching out to Microsoft Fabric Community.
To solve the issue of customers disappearing in months where they had no sales (e.g., February), you should use a separate Customer dimension table and a proper Date table, both related to your fact table. This ensures you can maintain customer visibility even when they have no sales in a selected month. Use the Customer table in visuals (not the sales table) and enable "Show items with no data" in the visual settings. To calculate the variation from December of the previous year, regardless of the selected month or whether there were sales, use the following DAX measures:
1. Sales A in December of the Previous Year:
Sales A Dec =
CALCULATE(
SUM(Sales[Product A]),
KEEPFILTERS('Customer'[Customer]),
FILTER(
ALL('Date'),
FORMAT('Date'[Date], "YYYY-MM") = FORMAT(EDATE(MAX('Date'[Date]), -MONTH(MAX('Date'[Date]))), "YYYY-12")
)
)2. Sales Variation from December:
Sales A Variation =
VAR CurrentSales = CALCULATE(SUM(Sales[Product A]))
VAR DecSales = [Sales A Dec]
RETURN
IF(NOT ISBLANK(DecSales), CurrentSales - DecSales)
These measures ensure that even when a customer has no sales in a filtered month, they are still shown in the report with their December sales and corresponding variation.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi Syndicate_Admin,
Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?
If you've already resolved the issue, you can mark the helpful reply as a "solution" so others know that the question has been answered and help other people in the community. Thank you again for your cooperation!
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you.