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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
AmalrajRRD1
Helper II
Helper II

Format Changes

Hi all,

I have month, Quarter and year colum. If i select month want to see latest month like July 2017 in text box, If i select Year i want to see like Jan 2017 to July 2017 (we have ten year data) . finally if i select quarter want to see Jan 2017 - mar 2017 (First quarter) also would like to see by quarter wise in text box ..

 

anyone can help me on this?

 

Thanks.

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee


@AmalrajRRD1 wrote:

Hi all,

I have month, Quarter and year colum. If i select month want to see latest month like July 2017 in text box, If i select Year i want to see like Jan 2017 to July 2017 (we have ten year data) . finally if i select quarter want to see Jan 2017 - mar 2017 (First quarter) also would like to see by quarter wise in text box ..

 

anyone can help me on this?

 

Thanks.


@AmalrajRRD1

I'd suggest to use a calendar table, when you'd like to show data for 2017, then pick up 2017 in the slicer. when to show data for Q1 2017, pick up Q1 in 2017. May I know why you don't like this way?

 

As to your requirement, there's some tricky way with complicated measures, the measures values could vary according to the slicer like 

value =
SWITCH (
    LASTNONBLANK ( yourFilter[YMQ], "" ),
    "Month", CALCULATE (
        SUM ( yourTable[col] ),
        FILTER (
            yourTable,
            yourTable[date] >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY ), 1 )
        )
    ),
    "Quarter", CALCULATE (
        SUM ( yourTable[col] ),
        FILTER (
            yourTable,
            yourTable[date] >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY ), 1 )
                && CALCULATE (
                    SUM ( yourTable[col] ),
                    FILTER (
                        yourTable,
                        yourTable[date]
                            < DATE ( YEAR ( TODAY () ), MONTH ( TODAY ) + 3, 1 )
                    )
                )
        )
    ),
    "Year", CALCULATE (
        SUM ( yourTable[col] ),
        FILTER ( yourTable, yourTable[date] >= DATE ( YEAR ( TODAY () ), 1, 1 ) )
    )
)

View solution in original post

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee


@AmalrajRRD1 wrote:

Hi all,

I have month, Quarter and year colum. If i select month want to see latest month like July 2017 in text box, If i select Year i want to see like Jan 2017 to July 2017 (we have ten year data) . finally if i select quarter want to see Jan 2017 - mar 2017 (First quarter) also would like to see by quarter wise in text box ..

 

anyone can help me on this?

 

Thanks.


@AmalrajRRD1

I'd suggest to use a calendar table, when you'd like to show data for 2017, then pick up 2017 in the slicer. when to show data for Q1 2017, pick up Q1 in 2017. May I know why you don't like this way?

 

As to your requirement, there's some tricky way with complicated measures, the measures values could vary according to the slicer like 

value =
SWITCH (
    LASTNONBLANK ( yourFilter[YMQ], "" ),
    "Month", CALCULATE (
        SUM ( yourTable[col] ),
        FILTER (
            yourTable,
            yourTable[date] >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY ), 1 )
        )
    ),
    "Quarter", CALCULATE (
        SUM ( yourTable[col] ),
        FILTER (
            yourTable,
            yourTable[date] >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY ), 1 )
                && CALCULATE (
                    SUM ( yourTable[col] ),
                    FILTER (
                        yourTable,
                        yourTable[date]
                            < DATE ( YEAR ( TODAY () ), MONTH ( TODAY ) + 3, 1 )
                    )
                )
        )
    ),
    "Year", CALCULATE (
        SUM ( yourTable[col] ),
        FILTER ( yourTable, yourTable[date] >= DATE ( YEAR ( TODAY () ), 1, 1 ) )
    )
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.