Forum Discussion
Measure Correct on Desktop, but Incorrect When Published
- 9 years ago
Hey thanks for responding.
I deleted the measure and recreated it a few times, and suddenly the issue dissappeared...really unsure how it fixed itself, but I guess simplifying the formula (as mentioned above) and just clearing whatever cache it was working with (by deleting/recreating the measure) seems to have fixed it.
I will come back to this thread if I run into this issue again.
I was unaware about the DISTINCTCOUNT() formula (thanks!), and have updated my formula:
Late Projects = IF(ISBLANK(DISTINCTCOUNT(TaskWithProjectDetail[YESProjectLate])),0,DISTINCTCOUNT(TaskWithProjectDetail[YESProjectLate]))
Unfortunately the sample data is sensitive in nature and I cannot share it. The column YESProjectLate returns the project name if the 'Planned Finish Date' (one date field) is behind the 'Actual Finish Date' (another date field), and returns blank if the project is on time. I needed to count distinct values in the YESProjectLate column because there are many rows with the same project name (this is how the data is strictured, so take it as a given that I cannot change).
For example:
| Project Name | Planned Finish Date | Actual Finish Date | YESProjectLate |
| ProjectA | 8/16/2016 | 9/16/2016 | ProjectA |
| ProjectB | 8/16/2016 | 7/16/2016 | |
| ProjectC | 8/16/2016 | 8/20/2016 | ProjectC |
However I'm still running into the same issue. Power BI Desktop returns the correct value, and the published version does not.
The published version from memory uploads your pbix, your data source conditions and details to powerbi web.
My biggest thing would be about the date table. I couldn't see if you have one or not, my suggestion would be to download a date table from the azure marketplace (free), through powerbi, "ExtendedCalender", draw a relationship link between your data table and the date table and the use the datekey in the date table as your date value instead of the date value in your data table.