Forum Discussion
totamum
Helper I
1 year agoCreate Card Showing Latest Value
I'm trying to create a Card which will display the latest Week on Week percentage that I have calculated. My table is below. The columns are measures based on other data. I would like to show the ...
- 1 year ago
Hi,
I am not 100% sure how your semantic model looks like, but I tried to create a sample pbix file like below.Please check the below picture and the attached pbix file.
users: = SUM( users[users] )OFFSET function (DAX) - DAX | Microsoft Learn
Previous week users: = IF ( NOT ISBLANK ( [users:] ), CALCULATE ( [users:], OFFSET ( -1, ALL ( period[week] ), ORDERBY ( period[week], ASC ) ) ) )WoW %: = DIVIDE([users:]-[Previous week users:], [Previous week users:])Latest WoW%: = VAR _t = FILTER ( ADDCOLUMNS ( ALL ( period[week] ), "@wow%", [WoW %:] ), [@wow%] <> BLANK () ) VAR _latestweeknumber = MAXX ( _t, period[week] ) RETURN CALCULATE ( [WoW %:], KEEPFILTERS ( period[week] = _latestweeknumber ) )
totamum
Helper I
1 year agoThank you very much that did it! Jihwan_Kim I'm not sure whether you able to summarise what the formula means/what it is doing. I need to learn DAX in any case but thank you 🙂
POSPOS Thank you also! My only issue is that my week numbers aren't working by calendar year so at the moment I've got 17th January as week 52 and not the latest week but otherwise nice and simple and worked. Thanks