Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Datanauts,
I have a data set with data containing number of assigned seats and provisioned seats. I calculated the week over week difference by first creating a measure "Total upto last week" by summing the provisioned seats and using a dateadd function and created another measure to calculate the difference between the sum of provisioned seats and total upto last week. I want to view these by the 13 weeks in a quarter, but the visual breaks when I try to add them to the graph. This is the error I get.
Error Message:
MdxScript(Model) (8, 127) Calculation error in measure 'cce_pro_dashboard'[Total Prov upto Last Week]: Function 'DATEADD' expects a contiguous selection when the date column is not unique, has gaps or it contains time portion.
I am also attaching a link to the sample pbix file, please download it:
https://drive.google.com/open?id=1hYDaBCJQNGfp1XGeNzAxeVAbGiNlaBMX
Thanking you in advance.
Akash.
Hi @Anonymous ,
You can create calendar table like DAX below, then create relationship between your fact data table and calendar table on date field.
Calendar = CALENDAR(MIN(data[Date]),MAX(data[Date]))
Or
Calendar =CALENDARAUTO() .
Then you can create the [Total prov upto last week] using calendar[Date].
Total prov upto last week = CALCULATE(SUM(data[provisioned_seats]),DATEADD(calendar[Date],-7,DAY))
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Amy (@v-xicai),
Thank you for your response. I have tried this, and created a relationship between the two tables, but it doesn't work. I also tried bringing in a fiscal_date table but to no avail 😞
Best,
Akash.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |