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.
i want to display YTD months and year ( from jan 2024 until jul 2024) on x axis in line chart by default if there are no selections made on date range slicer
if there are any selections made on date slicer then month on x axis should disply based on selections
pbix : https://drive.google.com/file/d/1Bh7Lm1xUbIVmIp-RH2Z_-oPPSSDDhGWw/view?usp=drive_link
Solved! Go to Solution.
@LeandroDeodato Thanks for your contribution on this thread.
Hi @powerbiexpert22 ,
You can follow the steps below to get it, please find the details in the attachment.
1. Create a measure as below
IsSlicerFiltered =
VAR _year =
SELECTEDVALUE ( 'Date'[Year] )
VAR _month =
SELECTEDVALUE ( 'Date'[MonthNo] )
RETURN
IF (
ISFILTERED ( 'Date'[Date] ),
1,
IF (
_year = YEAR ( TODAY () )
&& _month >= 1
&& _month <= MONTH ( TODAY () ),
1,
0
)
)
2. Apply the visual-level filter with the condition(IsSlicerFiltered is 1) on the line chart
Best Regards
i am able to acheive it by creating calculated column, the problem is it is very difficult for user to navigate from year 9999 using calendar as shown in last screenshot
@LeandroDeodato Thanks for your contribution on this thread.
Hi @powerbiexpert22 ,
You can follow the steps below to get it, please find the details in the attachment.
1. Create a measure as below
IsSlicerFiltered =
VAR _year =
SELECTEDVALUE ( 'Date'[Year] )
VAR _month =
SELECTEDVALUE ( 'Date'[MonthNo] )
RETURN
IF (
ISFILTERED ( 'Date'[Date] ),
1,
IF (
_year = YEAR ( TODAY () )
&& _month >= 1
&& _month <= MONTH ( TODAY () ),
1,
0
)
)
2. Apply the visual-level filter with the condition(IsSlicerFiltered is 1) on the line chart
Best Regards
Great solution!
Hi @LeandroDeodato ,
can you share more details, i tried to create measure however i need to display dimension values for month on x axis however measure returns only single value
try use HASONEVALUE in the mensure, if has one value selected in field month or year, your mensure apoint to selected value, else show both values.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
123 | |
78 | |
48 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |