Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Solved! Go to Solution.
Hi @rmsaunders,
Do you have any performance issue? Or just want to compact the formula? If so, please try out this one.
calc_TY_Sales_YTD = VAR var_Metric = SELECTEDVALUE ( table_Sales_Metrics[Metric] ) VAR var_TY_sales_YTD = CALCULATE ( SWITCH ( var_Metric, "Units", SUM ( SALES_TABLE[qty_sold] ), "Cost $", SUM ( SALES_TABLE[dollar_sold] ), "Retail $", SUM ( SALES_TABLE[retail_sold] ) ), DATESBETWEEN ( DATE_TABLE[date], [calc_Report_Start_Date], [calc_Report_End_Date] ) ) RETURN var_TY_sales_YTD
If it doesn't help, please provide a sample that we can download or copy with. Please mask the sensitive parts first.
Best Regards,
Hi @rmsaunders,
Do you have any performance issue? Or just want to compact the formula? If so, please try out this one.
calc_TY_Sales_YTD = VAR var_Metric = SELECTEDVALUE ( table_Sales_Metrics[Metric] ) VAR var_TY_sales_YTD = CALCULATE ( SWITCH ( var_Metric, "Units", SUM ( SALES_TABLE[qty_sold] ), "Cost $", SUM ( SALES_TABLE[dollar_sold] ), "Retail $", SUM ( SALES_TABLE[retail_sold] ) ), DATESBETWEEN ( DATE_TABLE[date], [calc_Report_Start_Date], [calc_Report_End_Date] ) ) RETURN var_TY_sales_YTD
If it doesn't help, please provide a sample that we can download or copy with. Please mask the sensitive parts first.
Best Regards,
v-jiascu-msft:
I just wanted to compact the formula, and your solution has done that.
Thanks!
Hmm, probably a better way, can you share sample data that can be copied and pasted so that I can try a few things? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490.
Also, there are some techniques here that might help.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
74 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |