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
TimmK
Helper IV
Helper IV

Sales of Current Year and Selected Month in Each Column

I use the slicers year and month.

 

The "Actual" table shows the sales from 2019 to 2022 (as selected in the year slicer) for month January (as selected in the month slicer).

 

The "Desired Result" table shows the sales of the current year (=2022) for the selected month in the month slicer (=January) for each year selected in the year slicer (= 2019 to 2022). The result should be dynamic based on the month slicer. For example, when I select February in the month slicer, each column should show the sales of the current year (=2022) and February.

What DAX formula can I use to achieve the "Desired Result" table? I want to use it for further percentage calculation.

 

We can use the measure [Sales] for DAX.

1.PNG

1 ACCEPTED SOLUTION
arichard19
Resolver I
Resolver I

You will want to try using the "ALLSELECTED()" function to ignore the additional year columns.

-
CY & CM =

 

VAR CY = YEAR(TODAY())

Return
CALCULATE('Report Measures'[Realized Revenue], ALLSELECTED(Calender[Year]), Calender[Year] = CY)
-
arichard19_0-1657093999963.pngarichard19_1-1657094017751.png

 



View solution in original post

1 REPLY 1
arichard19
Resolver I
Resolver I

You will want to try using the "ALLSELECTED()" function to ignore the additional year columns.

-
CY & CM =

 

VAR CY = YEAR(TODAY())

Return
CALCULATE('Report Measures'[Realized Revenue], ALLSELECTED(Calender[Year]), Calender[Year] = CY)
-
arichard19_0-1657093999963.pngarichard19_1-1657094017751.png

 



Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors