The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
In Power BI, I'm working with a WorkStationAudit Table containing columns such as StartDate, EndDate, CreatedDate, ResolutionDate, and Issuekey. My aim is to generate a Line and Clustered Column chart, with the x-axis representing YearMonth and the y-axis showing the count of Issuekey. The chart should include two lines: Actual and Planned. The Actual(count of actual completed wsa cumulatively) line is derived from the ResolutionDate, while the Planned line(shows cumulatively over each month how many wsa are planned for the year) is based on the StartDate. However, I'm encountering difficulty in selecting the appropriate date for the x-axis. If I use StartDate, only the Actual line functions correctly; if I opt for ResolutionDate, only the Planned line is accurate.
Any ideas/Suggestions would help Thanks!
I think what you need is to have a single date (dimension) table and multiple relationships. Then, create measures with USERELATIONSHIP. Checkout https://learn.microsoft.com/en-us/dax/userelationship-function-dax
Hi, @codingenthu
Based on your information, I create a sample data table:
Create a calculated column :
YearMonth = FORMAT('Table'[StartDate], "YYYY-MM")
Then create two measures :
Actual Count = CALCULATE(SUM('Table'[Issuekey]), FILTER(ALL('Table'), 'Table'[ResolutionDate] <= MAX('Table'[ResolutionDate])))
Planned Count = CALCULATE(SUM('Table'[Issuekey]), FILTER(ALL('Table'), 'Table'[StartDate] <= MAX('Table'[StartDate])))
Here is my preview:
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous Thank you for the reply!!
Actually in the visual i want to see both Actual and Planned Lines. So what i was trying to say is If i create YearMonth column based on StartDate then only Planned Line seems working as we have used StartDate in the Planned Line and Actual Line seems doesn't working.
@codingenthu Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |
User | Count |
---|---|
27 | |
18 | |
13 | |
9 | |
5 |