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.
I want to get names of January to current month in a column like Jan, Feb, mar etc
can anyone know about it how to get it from calendar.
Solved! Go to Solution.
Hi @Umair_Aslam ,
In your calendar table, add a new custom column like this:
// Will show all of current month
Current YTD =
if Date.IsInCurrentYear([Date]) and [Date] <= Date.EndOfMonth(Date.From(DateTime.LocalNow()))
then "Current YTD"
else null
Or like this:
// Will show only up to today
Current YTD =
if Date.IsInCurrentYear([Date]) and [Date] <= Date.From(DateTime.LocalNow())
then "Current YTD"
else null
Use your new column in your slicer, in the Slicer Selection option uncheck 'Use Ctrl to multi-select', and in the visual-level filter set 'Current YTD' to 'Is not blank'.
This will give you a single check box that you can toggle on/off.
Pete
Proud to be a Datanaut!
It isn't working like what I want. I want a single check box when select it then it will show visual from Jan to current month data of current year when I uncheck it it will show whole data can anybody help for this filter
Hi @Umair_Aslam ,
In your calendar table, add a new custom column like this:
// Will show all of current month
Current YTD =
if Date.IsInCurrentYear([Date]) and [Date] <= Date.EndOfMonth(Date.From(DateTime.LocalNow()))
then "Current YTD"
else null
Or like this:
// Will show only up to today
Current YTD =
if Date.IsInCurrentYear([Date]) and [Date] <= Date.From(DateTime.LocalNow())
then "Current YTD"
else null
Use your new column in your slicer, in the Slicer Selection option uncheck 'Use Ctrl to multi-select', and in the visual-level filter set 'Current YTD' to 'Is not blank'.
This will give you a single check box that you can toggle on/off.
Pete
Proud to be a Datanaut!
I have Solved my problem by using two visuals selecting bookmark
Hi @Umair_Aslam ,
Try this in a new blank query:
let
Source =
List.Transform(
{
Number.From( #date( Date.Year(DateTime.LocalNow()), 01, 01))
..
Number.From( Date.EndOfMonth( Date.From( DateTime.LocalNow())))
},
each Date.From(_)
),
convToTable = Table.FromList(Source, Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error),
addShortMonthName = Table.AddColumn(convToTable, "ShortMonthName", each Text.Start(Date.MonthName([Date]), 3))
in
addShortMonthName
Pete
Proud to be a Datanaut!
Covering 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.