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
Arioli_Chezhian
Helper II
Helper II

TotalYTD performance based on Slicer filter

Hello everyone,
I have a totalytd measure, and creating a bar chart based on date and total sales. Also I have a slicer which contains Month Name. If I filter for March month, the bar chart will show data only for March month  but my requirement should be like the visual should display till March month (Jan, Feb and Mar). Likewise if I select June month in the slicer, the bar chart should display data from January to June.

How to achieve this, please advice.

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Arioli_Chezhian 

 

You can try the following methods.

Measure = 
IF ( SELECTEDVALUE ( 'Slicer table'[Date] ) = BLANK (),
    1,
    IF ( SELECTEDVALUE ( 'Table'[Date] ) <= SELECTEDVALUE ( 'Slicer table'[Date] )
     && YEAR ( SELECTEDVALUE ( 'Table'[Date] ) ) = YEAR ( SELECTEDVALUE ( 'Slicer table'[Date] ) ),
        1,
        0 ) )

vzhangti_0-1698742959847.pngvzhangti_1-1698742972104.png

Is this the result you expect? Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

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

6 REPLIES 6
v-zhangti
Community Support
Community Support

Hi, @Arioli_Chezhian 

 

You can try the following methods.

Measure = 
IF ( SELECTEDVALUE ( 'Slicer table'[Date] ) = BLANK (),
    1,
    IF ( SELECTEDVALUE ( 'Table'[Date] ) <= SELECTEDVALUE ( 'Slicer table'[Date] )
     && YEAR ( SELECTEDVALUE ( 'Table'[Date] ) ) = YEAR ( SELECTEDVALUE ( 'Slicer table'[Date] ) ),
        1,
        0 ) )

vzhangti_0-1698742959847.pngvzhangti_1-1698742972104.png

Is this the result you expect? Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

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

 

some_bih
Super User
Super User

Hi @Arioli_Chezhian 

On link, last example is simple measure for TOTALYTD

https://learn.microsoft.com/en-us/dax/totalytd-function-dax?WT.mc_id=DP-MVP-4025372 

 

to Create Calendar Table Microsoft Learn follow instruction, and create relationships.

Create Calendar Table Microsoft Learn

https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables

 

After that insert slicer with Month name.

Hope this help





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






@some_bih  -  I already tried this but it's not working. If I select March month then even in bar chart it's getting filtered for March month alone. 

If I select march month, then it should show from January to March. 

Hi @Arioli_Chezhian please share some example with expected output





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






some_bih
Super User
Super User

Hi @Arioli_Chezhian TOTALYTD measure best work when you put Date columns from you Calendar / Date table, not from your fact table.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






@some_bih  - I need to achieve the concept which I mentioned earlier. Could you please advice on this.

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.