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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Total sales based on slicer selections

Helo experts,

 

I am trying to achieve a requirement using below dataset (which can't be altered). Hope i will get some solutions to achieve this.

Year

FY19_Sales

FY20_Sales

FY21_Sales

FY22_Sales

FY19

13

874

4565

874

FY19

343

372

22323

372

FY19

74

22

131231

22

FY20

874

13

23

456

FY20

372

343

21

223

FY20

22

74

121

131231

FY21

4565

23

13

23

FY21

22323

21

343

21

FY21

13123

121

74

121

FY22

23

4565

874

13

FY22

21

22323

372

343

FY22

121

31231

22

74

 

 

 

 

 

Total

41874

59982

159982

133773

 

I have to display a slicer with values FY19, FY20, FY21... Based on slicer selection, respective KPI value should be displayed.

Ex: If i select FY19 in slicer, KPI should display Sum(FY19_Sales) which is 41874. Based on slicer selection the KPI value should dynamically change. Can anyone please help me to achieve this using DAX.

 

Note: Totals in sample data are added for reference, which are not part of actual dataset.

 

Regards,

Chunduri

1 REPLY 1
PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

Here's a measure that returns the sum based on a single value selected in a slicer.

Sales Amt. = 
SWITCH(
    SELECTEDVALUE('Table'[Year]),
    "FY19", CALCULATE(SUM('Table'[FY19_Sales]), REMOVEFILTERS('Table'[Year])),
    "FY20", CALCULATE(SUM('Table'[FY20_Sales]), REMOVEFILTERS('Table'[Year])),
    "FY21", CALCULATE(SUM('Table'[FY21_Sales]), REMOVEFILTERS('Table'[Year])),
    "FY22", CALCULATE(SUM('Table'[FY22_Sales]), REMOVEFILTERS('Table'[Year]))
    )

It's a shame you cannot remodel this data.  The DAX could easily get more and more difficult because of the way it's currently shaped.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.