Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi guys,
I want to write dax query that shows sales on weekdays. But grand total and yearly total are not true. Could you help me for solving this problem?
Best regards.
Hi,
I couldnt solve it yet 😕
Hi, @AlfredoBIS
Has the problem been solved so far?
If you still need help, please share a sample file for further research.
Best Regards,
Community Support Team _ Eason
You can send a picture of your relationship just like I am sending:
You can send a picture of your relationship just like I am sending:
You can share a picture of your relationships.
Based on them I believe we can find a solution.
See if it helps you
Assuming that your date dimension table is correctly related to your fact table.
And in your dates dimension table you have a column that identifies whether the day is useful or not.
I suggest the steps and measures below:
WorkDays =
CALCULATE(
COUNT('📅dCalendar'[Work Day Value]),
'📅dCalendar'[Work Day Value] = 1)
SalesPerWorkingDay =
DIVIDE([Sales Amount] , [WorkDays])
Thank you so much.
Now
Hi,
Thank you so much for your answer. I used calculate but doesnt change result
Better to have year and month columns.then you can iterate over SUMMARIZE ( DimDate, DimDate[Year], DimDate[Month] ). It should work.
Hi I tried this: but couldnt solve yearly and grand total problem.
I don't understand why you are using SUMX.
your goal is not to know how many working days?
That's why I suggested using COUNT.
You just have a column in your date dimension table that identifies the date as useful or not.
Hi @rodrigosan,
I tried for calculating workdays like this. But result doesnt change. I want to correct grand total sales and yearly total sales.
You can share a picture of your relationships.
Based on them I believe we can find a solution.
Sure,
DimDate Table
FactSatles table
relationship:
Transform date/time columns to date
Date must be related only to date
ı changed datakey format to date.
But result didnt change . Year 2017i2018,2019 and grand total is not true
User | Count |
---|---|
53 | |
22 | |
18 | |
18 | |
13 |
User | Count |
---|---|
89 | |
87 | |
50 | |
34 | |
22 |