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.
want a functionality like data upto the specific month selected on slicer should be represented by black line and that after specific month by red line
Solved! Go to Solution.
Hi @arjumandsheikh,
I'd say you want to create two measure that you use instead of one then.
Measure before x =
Var selecteddate = Date( YEAR(MAX('Calendar'[Date])) , SELECTEDVALUE( Table'[Your specific month]), 1 )
Return
Calculate( [Sales] , 'Calendar'[Date] < selecteddate )
Measure after x =
Var selecteddate = Date( YEAR(MAX('Calendar'[Date])) , SELECTEDVALUE( Table'[Your specific month]), 1 )
Return
Calculate( [Sales] , 'Calendar'[Date] >= selecteddate )
Then apply the black color the the measure before x and red to the measure after x.
Let me know how it goes!
Br,
J
Hi @arjumandsheikh,
I'd say you want to create two measure that you use instead of one then.
Measure before x =
Var selecteddate = Date( YEAR(MAX('Calendar'[Date])) , SELECTEDVALUE( Table'[Your specific month]), 1 )
Return
Calculate( [Sales] , 'Calendar'[Date] < selecteddate )
Measure after x =
Var selecteddate = Date( YEAR(MAX('Calendar'[Date])) , SELECTEDVALUE( Table'[Your specific month]), 1 )
Return
Calculate( [Sales] , 'Calendar'[Date] >= selecteddate )
Then apply the black color the the measure before x and red to the measure after x.
Let me know how it goes!
Br,
J
thanks for your answer
Hi @arjumandsheikh ,
For this you need to create two measure and make the lines on top of each other something similar to:
Before Month =
CALCULATE (
SUM ( Table[Sales] ),
FILTER ( ALLSELECTED ( Table[Date] ), Table[Date] <= MAX ( Slicer[Date] ) )
)
After Month =
CALCULATE (
SUM ( Table[Sales] ),
FILTER ( ALLSELECTED ( Table[Date] ), Table[Date] >= MIN( Slicer[Date] ) )
)
Be aware that this sintax may need some changes.
Then just place the two lines on the values of the line chart.
If this does not work can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.
If the information is sensitive please share it trough private message.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
105 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
141 | |
107 | |
100 | |
82 | |
74 |