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.
Hello, im very new to power bi, and so im, still, a little lost week dax.
I want to make a visual that compares the last week, something like this:
which the goal should be the value of last week.
I tried to made a measure like this:
But shows me like this:
the original idea would be to show, in the column "Realizadas LastW" in the W51, the value of the W50, so in the KPI visual the goal would be of the W50.
I tried to search for an answer but couldnt find one.
what can i do to made this work?
thank you
Solved! Go to Solution.
Hi @Anonymous
It would probably be easier to have just the week numbers instead of the 'W' plus the number. If you have the weeks in the rows of the matrix as you show, you can use a measure like:
Measure= VAR _CurrentWeek = SELECTEDVALUE(Table1[Week]) VAR _PreviousWeek= "W" & VALUE(MID(_CurrentWeek, 2, LEN(_CurrentWeek)-1))-1 RETURN CALCULATE(SUM(Table1[realizadas]), Table1[Week]=_PreviousWeek)
Hi @Anonymous
It would probably be easier to have just the week numbers instead of the 'W' plus the number. If you have the weeks in the rows of the matrix as you show, you can use a measure like:
Measure= VAR _CurrentWeek = SELECTEDVALUE(Table1[Week]) VAR _PreviousWeek= "W" & VALUE(MID(_CurrentWeek, 2, LEN(_CurrentWeek)-1))-1 RETURN CALCULATE(SUM(Table1[realizadas]), Table1[Week]=_PreviousWeek)
Hello @AlB i have a column with the yearweek too, the W51 is represented with 201851.
But it worked 😄
Shows the goal as a WoW percentage
Thank you so much for the help.
@Anonymous
Cool
If it's what you were looking for, please accept the answer as solution so that it's visible for others as well.
Cheers
Done 😉
Just, for my knowledge.
What would be the measure if i had the week without the W?
Would be the same but without the mid function?
@Anonymous
Yes, if you have a number you can just subtract the 1 directly to get the previous week. You don't need all the hassle of converting forth and back between text and number.
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 |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |