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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mikebi
Helper III
Helper III

PowerBI Example with YTD, MDT and QTD slicer or buttons

Hello,

Does anyone have an example of how to create a power bi pbix file with YTD, MTD and QTD with year and month selections?

Either using a slicer or button is fine.

 

Thank You,

 

Michael

 

1 ACCEPTED SOLUTION

Hi @mikebi ,

Please review the following links, hope it can help you solve the problem.

Custom Date Period Selections in Power BI

vyiruanmsft_0-1710322038020.png

Solved: Slicer MTD, QTD, YTD to filter dates using the sli... - Microsoft Fabric Community

Final Value 1 = 
IF(HASONEFILTER(Table[CalcType]),
    SWITCH(SELECTEDVALUE(Table[CalcType]),
        "MTD", [Measure 1 MTD],
        "QTD", [Measure 1 QTD],
        "YTD", [Measure 1 YTD]
    ),
   BLANK()
)

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Ninja_Powered
Frequent Visitor

Does the inbuilt slicer functionality work for what you need? If you insert a slicer then change it to relative date in the slider settings then the user can select 'this week' 'this month' & 'this year'.

I really want it to say 'MTD', 'YTD, 'QTD' with user selection.

Hi @mikebi ,

Please review the following links, hope it can help you solve the problem.

Custom Date Period Selections in Power BI

vyiruanmsft_0-1710322038020.png

Solved: Slicer MTD, QTD, YTD to filter dates using the sli... - Microsoft Fabric Community

Final Value 1 = 
IF(HASONEFILTER(Table[CalcType]),
    SWITCH(SELECTEDVALUE(Table[CalcType]),
        "MTD", [Measure 1 MTD],
        "QTD", [Measure 1 QTD],
        "YTD", [Measure 1 YTD]
    ),
   BLANK()
)

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.