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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Column Management

Good afternoon, I need to show in a table three columns with the total of the sales depending on the month and year you choose:

For example, if I chose the year 2020 and February should show:

Dec 19 January 20 February 20

xx 1500 700 1800

yy 700 100 0

If I chose 2020 and April you should show:

February 20 March 20 April 20

xx 1800 1700 2000

yy 0 100 800

Atte,

Victor Yupa

1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

in order to get achieve this behaviour, I think you need to create a new stand-alone date-table(make sure the new table is not connected to any of the other tables), and create a measure like this:

Filter Measure = 
VAR _selectedMonth =
    IF (
        HASONEVALUE ( 'Year-Month'[YearMonthNum] );
        CALCULATE ( SELECTEDVALUE ( 'Year-Month'[YearMonthNum] ) );
        ( year(TODAY ()) - 2010 ) * 12
            + MONTH ( TODAY () )
    )
RETURN
    IF (
        COUNTROWS (
            FILTER (
                dimDate;
                dimDate[YearMonthNum] >= _selectedMonth - 2
                    && dimDate[YearMonthNum] <= _selectedMonth
            )
        ) > 0;
        1;
        0
    )
 

Use this measure in the filter pane, and set it to filter on equal to 1.

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors