Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
hello everyone,
i have a bar chart which i want to show the values from the beginning of the year(of selected date) until selected date
so lets say i chose november 2022 on my slicer,
i want to show values from january 2022 until november 2022,
if i select may 2021, i want to display values on chart from january 2021 until may 2021
and so on
i dont want the sum of value from jan to selected date but instead,
i want to display each month-year their sum value,
so here i selected march 2022,
what i want is to display from jan 2022 to march 2022 and it should show like this as if i selected jan 2022 until match 2022
Solved! Go to Solution.
Hi @eliasayyy ,
Please have a try.
Create a calendar date table.Then put it into the slicer.
Table = CALENDAR(DATE(2022,1,1),DATE(2023,12,31))
Then change the measureS.
Measure = var _selectedvaluedate=MAXX(ALLSELECTED('Table'),'Table'[Date])
var _month=MONTH(_selectedvaluedate)
var _year=YEAR(_selectedvaluedate)
return
IF(MAX('Table 1'[MONTH])<=_month&&MAX('Table 1'[YEAR])=_year,1,0)
Then filter the measure is 1.
Then create another measure.
Measure 2 = SUMX(FILTER(ALL('Table 1'),'Table 1'[MONTH]=SELECTEDVALUE('Table 1'[MONTH])&&'Table 1'[YEAR]=SELECTEDVALUE('Table 1'[YEAR])),'Table 1'[value])
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @eliasayyy ,
I have created a simple sample, please refer to my pbix file to see if it helps you.
Create 2 columns.
YEAR =
YEAR('Table 1'[date])
MONTH =
MONTH('Table 1'[date])
Then create a measure.
Measur =
VAR _MAXdate =
MAXX ( ALLSELECTED ( 'Table 1'[date] ), 'Table 1'[date] )
VAR _mindate =
MINX ( ALLSELECTED ( 'Table 1'[date] ), 'Table 1'[date] )
RETURN
CALCULATE (
SUM ( 'Table 1'[value] ),
FILTER (
ALL ( 'Table 1' ),
'Table 1'[YEAR] = SELECTEDVALUE ( 'Table 1'[YEAR] )
&& 'Table 1'[MONTH] = SELECTEDVALUE ( 'Table 1'[MONTH] )
)
)
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hello @Anonymous , i appreciate your reply but i think you got me wrong,
what i want it for my bar chart to show me, if in case i select march 2022 , all dates from january 2022 to march 2022,
if i select december 2021, i want to show all values from january 2021 to december 2021
if i selected february 2023, i want to show all values from january 2023 to february 2023
like i showed in my example above, when i selected march 2022, it only shows march 2022, what i want is AS IF i am selecting all dates from januray 2022 till march 2022, which means i DONT want to select all dates i want this result only from selecting march 2022
hello everyone,
i have a bar chart which i want to show the values from the beginning of the year(of selected date) until selected date
so lets say i chose november 2022 on my slicer,
i want to show values from january 2022 until november 2022,
if i select may 2021, i want to display values on chart from january 2021 until may 2021
and so on
i dont want the sum of value from jan to selected date but instead,
i want to display each month-year their sum value for each of the period,
so here i selected march 2022,
what i want is to display from jan 2022 to march 2022 and it should show like this as if i selected jan 2022 until match 2022
the second picture should be the expected result WITHOUT me having to select the dates,
i only want when i seelct a date, it shows me the values from first month of year to selcted date as explained above.
thank you
hi @eliasayyy
not sure if this is feasible. you expects a dynamic axis. an axis is typically feeded with a dataset column, but a dataset column can't be calculated with slicer input.
Hello @FreemanZ ,thank you for your reply is it possible to add another slicer and get what i want when i select a date from 1 slicer until the second slicer?
hi @eliasayyy
plot the chart with Month column. Feed a slicer with the Date or Month column. Or?
Hi @eliasayyy ,
Please have a try.
Create a calendar date table.Then put it into the slicer.
Table = CALENDAR(DATE(2022,1,1),DATE(2023,12,31))
Then change the measureS.
Measure = var _selectedvaluedate=MAXX(ALLSELECTED('Table'),'Table'[Date])
var _month=MONTH(_selectedvaluedate)
var _year=YEAR(_selectedvaluedate)
return
IF(MAX('Table 1'[MONTH])<=_month&&MAX('Table 1'[YEAR])=_year,1,0)
Then filter the measure is 1.
Then create another measure.
Measure 2 = SUMX(FILTER(ALL('Table 1'),'Table 1'[MONTH]=SELECTEDVALUE('Table 1'[MONTH])&&'Table 1'[YEAR]=SELECTEDVALUE('Table 1'[YEAR])),'Table 1'[value])
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |