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 am confused. I think it is a over complicated way to calculate something that is straight forward (or I may be wrong). Can you just use DISTINCTCOUNT() function like below?
Late Projects = DISTINCTCOUNT(TaskWithProjectDetail[YESProjectLate])
If this is not what you expect, can you share your sample data, and the desired result? Also, the formula used to calculate the calculated column [YESProjectLate] will also help.
- macintacos9 years agoRegular Visitor
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.
- ElliotP9 years agoPost Prodigy
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.
- Mi2n9 years agoMicrosoft Employee
Can you give the exact formula used to calculate the YESProjectLate column?
- v-sihou-msft9 years agoMicrosoft Employee
What's your data source?
I haven't reproduced your issue.
I created a sample table like yours, the measure shows same data in Power BI Desktop and Service.
Late Projects = IF ( ISBLANK ( COUNTROWS ( FILTER ( DISTINCT ( SELECTCOLUMNS ( Table3, "Late", Table3[YESProjectLate] ) ), NOT ( ISBLANK ( [Late] ) ) ) ) ), 0, COUNTROWS ( FILTER ( DISTINCT ( SELECTCOLUMNS ( Table3, "Late", Table3[YESProjectLate] ) ), NOT ( ISBLANK ( [Late] ) ) ) ) )Regards,
- macintacos9 years agoRegular Visitor
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.