Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
so the above graph is a clustered column chart .i don't ve data after march_24 and the line graph is showing straight line that is making sense .i want to show the line graph (one in green) till the month I have data . What dax should I use here
Solved! Go to Solution.
Hi, @Nidhi9392
Based on your description, you can try the following Measure to solve your problem.
MinDateForMaxLine2 =
VAR MaxLine2 =
MAX ( 'Table'[line2] )
VAR _maxline2 =
CALCULATE ( MAX ( 'Table'[line2] ), ALL ( 'Table' ) )
VAR _result =
MINX ( FILTER ( ALL ( 'Table' ), 'Table'[line2] = MaxLine2 ), 'Table'[date] )
VAR _filter =
IF (
SELECTEDVALUE ( 'Table'[date] ) > _result
&& SELECTEDVALUE ( 'Table'[line2] ) = _maxline2,
0,
1
)
VAR _sumLine2 =
CALCULATE (
SUM ( 'Table'[line2] ),
FILTER ( 'Table', _filter = 1 && 'Table'[line2] <> 0 )
)
RETURN
_sumLine2
Best Regards,
Yang
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 this does not work, could you please share some sample data without sensitive information and expected output.
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
Hi, @Nidhi9392
Based on your description, you can try the following Measure to solve your problem.
MinDateForMaxLine2 =
VAR MaxLine2 =
MAX ( 'Table'[line2] )
VAR _maxline2 =
CALCULATE ( MAX ( 'Table'[line2] ), ALL ( 'Table' ) )
VAR _result =
MINX ( FILTER ( ALL ( 'Table' ), 'Table'[line2] = MaxLine2 ), 'Table'[date] )
VAR _filter =
IF (
SELECTEDVALUE ( 'Table'[date] ) > _result
&& SELECTEDVALUE ( 'Table'[line2] ) = _maxline2,
0,
1
)
VAR _sumLine2 =
CALCULATE (
SUM ( 'Table'[line2] ),
FILTER ( 'Table', _filter = 1 && 'Table'[line2] <> 0 )
)
RETURN
_sumLine2
Best Regards,
Yang
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 this does not work, could you please share some sample data without sensitive information and expected output.
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