简体   繁体   中英

Creating a historical data set in Power Bi from a SQL Server

Monthly I send out forms that must be completed. The people looking at the Power Bi report that I have created want to see the historical data. They want to know on the 3rd 5th and 10th what percentage of the company has completed the survey on a monthly basis. So for example by the 3rd of February 82% completed but by the 3rd of March 83% had completed it. These forms are for compliance policies. How could I set this up in Power Bi? Another way to do this would be to run some sort of SQL Stored Procedure like this but I don't know the best way to do this to make it dynamic for the year.

SELECT 
AnsweredSurvey,
Month,
ModifiedDate
FROM Answers
WHERE Year = YEAR(getDate()) 
AND TemplateId = '439D8B35-4CAC-4D71-946A-BB67E8BAC19F' 
AND ModifiedDate < DATEFROMPARTS(YEAR(getDate()), 02, 04)

But this does not account for being able to see previous years

我能够通过在 Power BI 中进行一些可以由筛选器操作的措施来解决这个问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM