Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
nmhung49
Helper II
Helper II

How to show data from first month selected month of slicer

I want to show the result as shown above That is, when I select the slicer in any month, it will show the result from January to the month I select.

For example, if I select May, it will show the result from January to May

nmhung49_1-1724305352990.png

Attach file

Thank you

 

1 ACCEPTED SOLUTION

@nmhung49  Yes it is possible. Though disconnected table is a very powerful feature. Since you want to use your calendar table. Follow the steps mentioned below.

1. First create a duplicate calendar table. You can use dax or power query to duplicate your calendar table. I named it 'Calendar2'.

2. Need to create a relationship between your original calendar table and duplicate calendar table with "Many to One" Relationship (Many side would be your calendar table and one side would be duplicate calendar table). Cross filter direction would be "Single" and make this relationship inactive.

 

Keep in mind that, you may face error during relationsip building, due to custom dax column index. I would suggest to change that formula from Index = Calendar[Date].MonthNo to Index = Month(Calendar[Date])

3. Go to your table visual, and remove "Index" column from rows format option and place index from "Duplicate calendar" Table. In this case "Calendar2".

4. Create a simple measure Sum of Value = SUM(Data[Value]).

5. Create the below final measure to show previous all month from first to till slicer selection.

Sum of Value Prev All Month =

VAR _maxDate = MAX('Calendar'[Date])

VAR _selectedMonth = SELECTEDVALUE('Calendar'[Index], MAX('Calendar'[Index]))

VAR _PrevDates =
        DATESINPERIOD(
            calendar2[Date],
            _maxDate,
            -_selectedMonth,
            MONTH
        )

VAR _result =
    CALCULATE(
        [Sum of Value],
        REMOVEFILTERS('Calendar'),
        KEEPFILTERS(_PrevDates),
        USERELATIONSHIP('Calendar'[Date], calendar2[Date])
    )
RETURN
_result

 

Place the above measure in the table visual and remove any other measure or value column. You will get your desired result.

In this way, you can use your calendar table month in the slicer and able to slice data from first month to till your slicer selection.

 

 

If this solved your problem, Please accept it as a solution!!

View solution in original post

3 REPLIES 3
nmhung49
Helper II
Helper II

@shafiz_p 

I want to select value Month from Slicer Calendar[MonthName] of Calendar Table. How do it

 

Thank you

@nmhung49  Yes it is possible. Though disconnected table is a very powerful feature. Since you want to use your calendar table. Follow the steps mentioned below.

1. First create a duplicate calendar table. You can use dax or power query to duplicate your calendar table. I named it 'Calendar2'.

2. Need to create a relationship between your original calendar table and duplicate calendar table with "Many to One" Relationship (Many side would be your calendar table and one side would be duplicate calendar table). Cross filter direction would be "Single" and make this relationship inactive.

 

Keep in mind that, you may face error during relationsip building, due to custom dax column index. I would suggest to change that formula from Index = Calendar[Date].MonthNo to Index = Month(Calendar[Date])

3. Go to your table visual, and remove "Index" column from rows format option and place index from "Duplicate calendar" Table. In this case "Calendar2".

4. Create a simple measure Sum of Value = SUM(Data[Value]).

5. Create the below final measure to show previous all month from first to till slicer selection.

Sum of Value Prev All Month =

VAR _maxDate = MAX('Calendar'[Date])

VAR _selectedMonth = SELECTEDVALUE('Calendar'[Index], MAX('Calendar'[Index]))

VAR _PrevDates =
        DATESINPERIOD(
            calendar2[Date],
            _maxDate,
            -_selectedMonth,
            MONTH
        )

VAR _result =
    CALCULATE(
        [Sum of Value],
        REMOVEFILTERS('Calendar'),
        KEEPFILTERS(_PrevDates),
        USERELATIONSHIP('Calendar'[Date], calendar2[Date])
    )
RETURN
_result

 

Place the above measure in the table visual and remove any other measure or value column. You will get your desired result.

In this way, you can use your calendar table month in the slicer and able to slice data from first month to till your slicer selection.

 

 

If this solved your problem, Please accept it as a solution!!

shafiz_p
Super User
Super User

Hi @nmhung49  You can solve this problem using a disconnected table. Create a disconnected table of month. See image below:

shafiz_p_0-1724319176292.png

 

Create measure : 

Sum of Value = SUM(Data[Value])
 
Create another measure :
Total Value =
VAR _max = SELECTEDVALUE('Index table'[Index], MAX('Index table'[Index]))

RETURN
IF(SELECTEDVALUE('Calendar'[Index]) <= _max, [Sum of Value])
 
In table visual, Place 'Calendar'[Index] in row and in value section place [Total Value] measure. Create a slicer with month from 'Index table'. You are done. Sort month by index number.
 
Output:

shafiz_p_6-1724320034783.pngshafiz_p_7-1724320066201.png

 

shafiz_p_8-1724320092606.png

 

 

Hope this helps!!

If your problem solved, please accept it as a solution!!

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.