Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All
This is my problem below.
I have serveral cumulative lines in a graph.
how do i make my cumulative line grpah stap at the week it's meant to stop, not all the way to end.
I am using a userelationship to make relationship between line and week (date) table.
Query that i used...
thank you,
CL
Solved! Go to Solution.
Hi @colourfullife ,
Please try this:
CSU SP_IRN =
VAR __Max =
MAXX ( ALL ( 'Sheet2' ), [Contractual] )
VAR _Min =
MINX ( ALL ( Sheet2 ), [Contractual] )
VAR RESULT =
IF (
MAX ( 'Date'[Date] ) > __Max,
BLANK (),
CALCULATE (
COUNTA ( 'Sheet2'[IRN] ),
USERELATIONSHIP ( Sheet2[IRN], 'Date'[Date] ),
FILTER (
ALLSELECTED ( 'Date'[Date] ),
( 'Date'[Date] <= MAX ( 'Date'[Date] ) )
)
) + 0
)
RETURN
IF ( MAX ( 'Date'[Date] ) >= _Min, RESULT )
@colourfullife - So generally you would want to wrap your calculation in an IF statement, like:
IF(MAX('Table'[Date]) > TODAY(),BLANK(),<your calculation goes here>)
is the query for stop line till today?
i want the lines stop when it supposed to stop based on the plan/ forecast date..
@colourfullife - It was an example. You really didn't post enough information for me to be more specific. I don't know what "when it is supposed to" means. 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.
thanks for your posting.
i attched my example pbi file and basedata excel file.
the lines continue till the end of year even though. it seems like it counts the blanks..
i want the lines stop where it doens't have values there..
PBI File : example pbi
Data base : example database excel
Regards,
CL
@colourfullife - Still no idea of exactly what you want but see if the attached PBIX (below sig) is what you are looking for. If not, going to have to explain things better. The basic pattern:
CSU SP_Delivery =
VAR __Max = MAXX(ALL('Sheet2'),[Contractual])
RETURN
IF(MAX('Date'[Date]) > __Max,
BLANK(),
CALCULATE(
COUNTA('Sheet2'[Delivery]),
USERELATIONSHIP(Sheet2[Delivery],'Date'[Date]),
FILTER(
ALLSELECTED('Date'[Date]),
('Date'[Date] <= MAX('Date'[Date]))
)
)
)
I think you got what i want to show
Can you please find link for the graph that i created with your suggested query? using suggested query,
because 1 line (IRN) out of 3 doesn't appear properly. i am not sure why..
I made what i want to show in excel : What i want to show to make it clear vision.
do you have any ideas?
Current graph
What i want to show
Hi @colourfullife ,
Please try this:
CSU SP_IRN =
VAR __Max =
MAXX ( ALL ( 'Sheet2' ), [Contractual] )
VAR _Min =
MINX ( ALL ( Sheet2 ), [Contractual] )
VAR RESULT =
IF (
MAX ( 'Date'[Date] ) > __Max,
BLANK (),
CALCULATE (
COUNTA ( 'Sheet2'[IRN] ),
USERELATIONSHIP ( Sheet2[IRN], 'Date'[Date] ),
FILTER (
ALLSELECTED ( 'Date'[Date] ),
( 'Date'[Date] <= MAX ( 'Date'[Date] ) )
)
) + 0
)
RETURN
IF ( MAX ( 'Date'[Date] ) >= _Min, RESULT )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |