Forum Discussion

aghnamahardhika's avatar
aghnamahardhika
Frequent Visitor
1 year ago

Date slicer label not working on table

Hello, Power BI experts....,

 

I have a visual that have slicer date_2 as follow, in the example I choose "February" as month and "2025" as year.

 

 

I then make a measure of CurrentMonth MTD = LASTDATE(Date_2[Date])

 

When I test the measure on card visual, it shows end of February, as expected

 

However, when I put the measure on a column in the table as follow, it instead show "Dec 2025" not "Feb 2025", the slicer didn't seem to work on the table

 

The endgoal is to make the label shown on x-axis of a line and clustered

 

 

Is there any workaround to make the label can follow the slicer. This is quite frustrating since I have got all the amount on the visual correct following the slicer, but not the date label.

 

Thank you in advance!

 

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi aghnamahardhika ,

    Since calculated columns are evaluated at row level they don't respond dynamically to context changes like measures do.

    When you're trying to call a measure within a calculated column (which has a row-by-row static evaluation), this leads to issues because the measure will not know how to behave without the dynamic context it usually receives in visual.

    You can instead try using this-

    CalculatedColumn =
    VAR LastDate =
    CALCULATE(
    MAX(Table[Date]),
    FILTER(
    Table,
    Table[PreviousCurrentBudget] = "Previous" && Table[mtdytd]="MTD")
    )
    RETURN
    LastDate

    Hope this helps!!

    • aghnamahardhika's avatar
      aghnamahardhika
      Frequent Visitor

      Hi Anonymous 

      Thank you for the answer. Unfortunately it does not return a desired result. If it is correct the Current MTD should return Feb 2025.

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi aghnamahardhika,

         

        Ensure the relationships between Date_2 and other tables to confirm that filtering is correctly applied.

         

        Regards,

        Vinay Pabbu

  • Hi!

     

    For the added context, for those who find this post. Since by default custom table do not affected by slicer, You can suggest any method outside of using a custom "PCB" Table like this as long as the output dynamically show the correct month year ("MMM YYYY") based on month and year slicer on Line and Clustered Column Chart visual.

     

    Thank you!

  • Hi aghnamahardhika

     

    The slicer in the report view can't be passed to the table view, so the method you're using doesn't work.

     

    You can upload a case file and I can help try to implement it, or you can refer to the following method:

     

    1. create an auxiliary table for the X-axis that contains all the items that may appear in the X-axis.

     

    2. conditionally displaying "X-axis items that should be shown" in the chart with their corresponding values based on what the slicer selects, and returning blank values for the rest of the items. Because empty X-axis items will be hidden automatically.

     

     

     

    Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

     

    Thank you~

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi aghnamahardhika,

     

    As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
    If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

     

    Regards,
    Vinay Pabbu

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi aghnamahardhika.

       

      May I ask if you have gotten this issue resolved?

      If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

       

      Regards,
      Vinay Pabbu

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi @aghnamahardhika,

         

        As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
        If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

         

        Regards,
        Vinay Pabbu