Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All,
I need your help.
I created accumul. line graph with query below.
it's about progress ( plan vs actual) graph by week.
Solved! Go to Solution.
Hi @colourfullife ,
There is an inactive relationship, so the date will show the date of the active relationship.
So we need to create two tables and create relationship separately.
1. In power query editor, we need to copy a table and delete the Delivery column. Then filter out the null value in the IRN column.
2. Then create active relationship between date table.
3. At last we can create two measures to get the result.
Measure =
CALCULATE (
COUNTA ( 'Data - CSU SP PO'[Delivery] ),
FILTER (
ALLSELECTED ( 'Calendar'[Date] ),
ISONORAFTER (
'Calendar'[Date], MAX ( 'Data - CSU SP PO'[Delivery] ), DESC
)
)
)
Measure 2 =
CALCULATE (
COUNTA ( 'Data - CSU SP PO (2)'[IRN] ),
FILTER (
ALLSELECTED('Calendar'[Date]) ,
ISONORAFTER (
'Calendar'[Date], MAX ( 'Data - CSU SP PO (2)'[IRN] ), DESC
)
)
)
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
Hi @colourfullife ,
How about the result after you follow the suggestions mentioned in my original post?
Could you please provide more details or expected result about it If it doesn't meet your requirement?
If you've fixed the issue on your own please kindly share your solution. If the above posts help, please kindly mark it as a solution to help others find it more quickly.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @colourfullife ,
Don't you want to show the straight line on the right?
If yes, maybe you can change your FILTER formula.
We create a sample the you can refer.
Maybe you can try the following measure.
CSU SP_Contractual =
CALCULATE (
COUNTA ( 'Data - CSU SP PO'[CONTRACTUAL_DELIVERY_DATE] ),
USERELATIONSHIP ( 'Data - CSU SP PO'[CONTRACTUAL_DELIVERY_DATE], 'calendar'[Date] ),
FILTER (
ALLSELECTED ( 'Calendar'[Date] ),
ISONORAFTER (
'Calendar'[Date], MAX ( 'Data - CSU SP PO'[CONTRACTUAL_DELIVERY_DATE] ), DESC
)
)
)
If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply?
It will be helpful if you can show us the exact expected result based on the tables.
Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your reply.
Yes what i want is i don't want to see the line right.
There is no value but it still contines.
I tried the query you suggested.
It doens't show anymore the line right but the value is incorrect.
- The delivery doesn't start from week 28, it starts from W33.. and the value is also not correct.
sharing the example database excel file : Example database
thank you,
CL
Hi @colourfullife ,
We can create two measures and there is no relationship between two tables to meet your requirement.
Measure =
CALCULATE(
COUNTA('Table'[Delivery]),FILTER('Table','Table'[Delivery]=MAX('Date'[Date])),FILTER(ALLSELECTED('Date'),'Date'[Date]<=MAX('Table'[Delivery])))
Measure 2 =
CALCULATE(
COUNTA('Table'[IRN]),
FILTER('Table','Table'[IRN]=MAX('Date'[Date])),
FILTER(ALLSELECTED('Date'),'Date'[Date]<=MAX('Table'[IRN])))
We found there is blank value in your IRN column.
Maybe you can separate the two columns and delete the blank value in IRN column using Power Query Editor.
Then create two active relationships using the two tables and Date table.
At last we can create two measures.
Measure 3 =
CALCULATE(
COUNTA('Table (3)'[Delivery]),FILTER(ALLSELECTED('Date'),'Date'[Date]<=MAX('Table (3)'[Delivery])))
Measure 4 =
CALCULATE(
COUNTA('Table (2)'[IRN]),FILTER(ALLSELECTED('Date'),'Date'[Date]<=MAX('Table (2)'[IRN])))
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
This is my query for accumulative line by week.
I have a relationship between my data and date using usereltionship..
Hi @colourfullife ,
There is an inactive relationship, so the date will show the date of the active relationship.
So we need to create two tables and create relationship separately.
1. In power query editor, we need to copy a table and delete the Delivery column. Then filter out the null value in the IRN column.
2. Then create active relationship between date table.
3. At last we can create two measures to get the result.
Measure =
CALCULATE (
COUNTA ( 'Data - CSU SP PO'[Delivery] ),
FILTER (
ALLSELECTED ( 'Calendar'[Date] ),
ISONORAFTER (
'Calendar'[Date], MAX ( 'Data - CSU SP PO'[Delivery] ), DESC
)
)
)
Measure 2 =
CALCULATE (
COUNTA ( 'Data - CSU SP PO (2)'[IRN] ),
FILTER (
ALLSELECTED('Calendar'[Date]) ,
ISONORAFTER (
'Calendar'[Date], MAX ( 'Data - CSU SP PO (2)'[IRN] ), DESC
)
)
)
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
@colourfullife , You try using the date from table in max
CSU SP_Contractual =
CALCULATE(
COUNTA('Data - CSU SP PO'[CONTRACTUAL_DELIVERY_DATE]), USERELATIONSHIP('Data - CSU SP PO'[CONTRACTUAL_DELIVERY_DATE],'calendar'[Date]),
FILTER(
ALLSELECTED('Calendar'[Date]),
'Calendar'[Date]<= MAX('Data - CSU SP PO'[CONTRACTUAL_DELIVERY_DATE])))
@colourfullife you can do something like this
CSU SP_Contractual =
VAR __c = COUNTA('Data - CSU SP PO'[CONTRACTUAL_DELIVERY_DATE])
RETURN
CALCULATE(
COUNTA('Data - CSU SP PO'[CONTRACTUAL_DELIVERY_DATE]), USERELATIONSHIP('Data - CSU SP PO'[CONTRACTUAL_DELIVERY_DATE],'calendar'[Date]),
FILTER(
ALLSELECTED('Calendar'[Date]),
ISONORAFTER('Calendar'[Date], MAX('Calendar'[Date]), DESC)))
*
DIVIDE ( __c, __c )
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2kthanks for your reply.
in fact, i have a few more lines to add in the same graph.
when i use the same query you advised for others, the other line doen't look right in the graph..?
User | Count |
---|---|
119 | |
78 | |
59 | |
52 | |
48 |
User | Count |
---|---|
171 | |
117 | |
61 | |
59 | |
53 |