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

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

Reply
mdaamirkhan
Post Prodigy
Post Prodigy

Switch Case not working

Hi All,

 

I have need help in my Dax query below  which I have highlighted in red is not returning any value in that table

Can you help me on dax 

Selected Time Period =
VAR CurrentItem = SELECTEDVALUE( 'Time Period'[ID])
VAR CurrentItem_ = SELECTEDVALUE('wt_fin_staging pl_sorting'[Account_ (Normalized)])
RETURN
SWITCH( TRUE(),
CurrentItem_ = "Other staff costs",CALCULATE([Total Actual],FILTER(wt_fin_pl_actuals_monthly_summary,wt_fin_pl_actuals_monthly_summary[account_description] = CurrentItem_)),
CurrentItem = 1, TOTALMTD([Total Actual],'wt_fin_staging dim_date'[date].[Date]),
CurrentItem = 2, TOTALQTD([Total Actual],'wt_fin_staging dim_date'[date].[Date]),
CurrentItem = 3, [Total Actual],
CurrentItem = 4, TOTALYTD([Total Actual],'wt_fin_staging dim_date'[date].[Date])
)
Screenshot 2022-08-09 002455.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mdaamirkhan ,

 

Please try to separate this part separately to test whether the result is returned.

Selected Time Period =
VAR CurrentItem_ = SELECTEDVALUE('wt_fin_staging pl_sorting'[Account_ (Normalized)])
RETURN
SWITCH( TRUE(),
CurrentItem_ = "Other staff costs",CALCULATE([Total Actual],FILTER(wt_fin_pl_actuals_monthly_summary,wt_fin_pl_actuals_monthly_summary[account_description] = CurrentItem_)))

 

Best Regards,

ShundaSteph

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @mdaamirkhan ,

 

Please try to separate this part separately to test whether the result is returned.

Selected Time Period =
VAR CurrentItem_ = SELECTEDVALUE('wt_fin_staging pl_sorting'[Account_ (Normalized)])
RETURN
SWITCH( TRUE(),
CurrentItem_ = "Other staff costs",CALCULATE([Total Actual],FILTER(wt_fin_pl_actuals_monthly_summary,wt_fin_pl_actuals_monthly_summary[account_description] = CurrentItem_)))

 

Best Regards,

ShundaSteph

mdaamirkhan
Post Prodigy
Post Prodigy

Any idea what will be correct dax 

Helpful resources

Announcements
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.

Top Solution Authors
Top Kudoed Authors