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,
I need to create a variation % between the current week and the previous week. In excel formula ((sessions - (sessions-1)) / (sessions-1). But, I don't know with DAX expressions.
This is a table
And this is a result that I want. Thank's for help !!
Hi @MontsePuig,
You can use Lookupvalue function to get last week session. Lookupvalue returns the value in result_columnName for the row that meets all criteria specified by search_columnName and search_value.
LOOKUPVALUE( <result_columnName>, <search_columnName>, <search_value>[, <search_columnName>, <search_value>]…)
Test data Table
Create a table by using DAX below.
Table 2 = SUMMARIZE('Table','Table'[Year],'Table'[Week],"WeekTotal",CALCULATE(SUM('Table'[Sessions]),ALLEXCEPT('Table','Table'[Year],'Table'[Week])))
Create two calculated column.
LastWekkSession = LOOKUPVALUE('Table 2'[WeekTotal],'Table 2'[Year],'Table 2'[Year],'Table 2'[Week],'Table 2'[Week]-1)
Var Session = FORMAT(('Table 2'[WeekTotal]-'Table 2'[LastWekkSession])/'Table 2'[LastWekkSession],"0.00%")
Regards,
Charlie Liao
Hi, @v-caliao-msft , thank you very much for your help!!
This is a result, thanks
But, now, I have problem with the relationship new table 2 between table. You can see this file.
Thank's
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 |
---|---|
109 | |
95 | |
77 | |
65 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |