Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
totamum
New Member

Create 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 latest value in the card, which is 188%.  

 

totamum_2-1734540214761.png

 

totamum_1-1734540043932.png

 

I tried the DAX formula below following a post with a similar request but I got a Plaeholder error.  I wasn't able to put the WOW% after SUM, it didn't come up for me to select, clearly I've not done something quite right

 

Latest WoW % = VAR endDate = LASTDATE ('Cumulative Users'[Week])
RETURN
CALCULATE(
    SUM('Cumulative Users'[Week]),'Cumulative Users'[WoW %]
    = endDate
)

 

Any help would be much appreciated

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

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.

 

Jihwan_Kim_1-1734541931074.png

 

 

Jihwan_Kim_0-1734541868099.png

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 ) )

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

4 REPLIES 4
totamum
New Member

Thank 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

v-jianpeng-msft
Community Support
Community Support

Your solution is so great Jihwan_Kim and POSPOS , It's worked !

Hi, @totamum 

I wish you all the best. Previously, Super user Jihwan_Kim and POSPOS provided a solution to help you solve the problem. Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?
If you've already resolved the issue, you can mark the helpful reply as a "solution" so others know that the question has been answered and help other people in the community. Thank you again for your cooperation!
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.

 

Best Regards

Jianpeng Li

POSPOS
Post Patron
Post Patron

@totamum :
Step 1: Create a calculated column

Column = IF('Table'[Week]=MAX('Table'[Week]),"Max")

POSPOS_1-1734542135629.png

 


Step 2: Restrict the card with the calculated column to "Max". This will show the latest week value.

POSPOS_0-1734542098902.png

 


Hope this helps.

Jihwan_Kim
Super User
Super User

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.

 

Jihwan_Kim_1-1734541931074.png

 

 

Jihwan_Kim_0-1734541868099.png

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 ) )

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.