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.
Hi,
So I'm a heavy Tableau user and I wrote this expression
if(DATEDIFF('year',[Actual-Date Parameter],[Actual-Date])=0 AND [Actual-Date]<=[Actual-Date Parameter] )
THEN ([PY Turnover]) end
In powerBI, I understand that I'll have to use tables instead of [Actual-Date Parameter], but I'm still unable to write the expression.
Also, Can I somehow make a single select filter?
Just for background:
What I want to do with this expression is that, when a user clicks on a certain month, it should give a YTD value up until that month.
so 'Feb' would give me Jan+Feb
'March' would give me Jan+Feb+March.
Any help would be appreciated.
Thanks.
Solved! Go to Solution.
Hi @Lisa_Brown,
Based on my test, you could refer to below steps:
Sample data:
Create a measue and you could see the result:
Measure = CALCULATE(SUM(Table1[Sales]),FILTER(ALL('Table1'),'Table1'[Fisacl Month]<=SELECTEDVALUE('Table1'[Fisacl Month])))
You can also download the PBIX file to have a view.
https://www.dropbox.com/s/q4195c2i00oqym9/Tableau%20expresstion%20to%20DAX.pbix?dl=0
Regards,
Daniel He
Hi @Lisa_Brown,
Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?
Regards,
Daniel He
Hi @Lisa_Brown,
Based on my test, you could refer to below steps:
Sample data:
Create a measue and you could see the result:
Measure = CALCULATE(SUM(Table1[Sales]),FILTER(ALL('Table1'),'Table1'[Fisacl Month]<=SELECTEDVALUE('Table1'[Fisacl Month])))
You can also download the PBIX file to have a view.
https://www.dropbox.com/s/q4195c2i00oqym9/Tableau%20expresstion%20to%20DAX.pbix?dl=0
Regards,
Daniel He
in general for YTD calculation for a Measure you would use following syntax
Measure YTD = CALCULATE ( [Measure], DATESYTD ( CalendarTable[Date] ) )
so depending on your data structure you would need to adjust the naming
in general I recommend reading this bit, it covers most essential DAX concepts
https://www.powerpivotpro.com/wp-content/uploads/2015/10/PowerPivotPro-Reference-Card.pdf
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 |
---|---|
112 | |
97 | |
82 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |