Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello,
I have a problem where I am trying to only show the MIN and MAX date points on a line chart. The MAX date will dynamically change with a slicer from another column so I can't use a static RANX on a calculated column.
Here's a visual of my problem.
As you can see there are loads of 0 values. I am looking to get a straight line from the first point to a dynamic last point based on a slicer.
Does anyone have any thoughts on how to do this with measures?
Thanks a lot,
Pete
Solved! Go to Solution.
Hi @PMeadows ,
Please create a new measure like:
Measure =
VAR __first_noblank_date = CALCULATE(FIRSTNONBLANK('Date'[Date],[YourMeasureName]),ALLEXCEPT('Table','Table'[Legend Field]))
VAR __last_noblank_date = CALCULATE(LASTNONBLANK('Date'[Date],[YourMeasureName]),ALLEXCEPT('Table','Table'[Legend Field]))
VAR __first_noblank_value = CALCULATE([YourMeasureName],'Date'[Date]=__first_noblank_date)
VAR __last_noblank_value = CALCULATE([YourMeasureName],'Date'[Date]=__last_noblank_date)
VAR __result = SWITCH(SELECTEDVALUE('Date'[Date]),__first_noblank_date,__first_noblank_value,__last_noblank_date,__last_noblank_value)
RETURN
__result
output:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly--How to provide sample data in the Power BI Forum--China Power BI User Group
Hi @PMeadows ,
Please create a new measure like:
Measure =
VAR __first_noblank_date = CALCULATE(FIRSTNONBLANK('Date'[Date],[YourMeasureName]),ALLEXCEPT('Table','Table'[Legend Field]))
VAR __last_noblank_date = CALCULATE(LASTNONBLANK('Date'[Date],[YourMeasureName]),ALLEXCEPT('Table','Table'[Legend Field]))
VAR __first_noblank_value = CALCULATE([YourMeasureName],'Date'[Date]=__first_noblank_date)
VAR __last_noblank_value = CALCULATE([YourMeasureName],'Date'[Date]=__last_noblank_date)
VAR __result = SWITCH(SELECTEDVALUE('Date'[Date]),__first_noblank_date,__first_noblank_value,__last_noblank_date,__last_noblank_value)
RETURN
__result
output:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly--How to provide sample data in the Power BI Forum--China Power BI User Group
Thanks so much!
User | Count |
---|---|
84 | |
80 | |
72 | |
71 | |
55 |
User | Count |
---|---|
108 | |
106 | |
93 | |
85 | |
67 |