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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Ratax
Helper I
Helper I

Card Help

Hello

 

i need help with the DAX code for a card in my dashboard.

 

I want to make 2 cards in my POWER BI dashboard, but can't get it to work.

I wanted to show the highest Value column counter, excluding all the values that have something written in the error column. So the maximum value would be 12.

 

Also so the last entry in the column, and if it's possible anchor it to the date. So even if the database isn't sorted by date, it is still the last according to date.

 

 

 

Skitse (2).png

 

Hope someone can help

 

Regards

Ratax

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Ratax,

 

You may use TOPN Function.

Measure =
MAXX (
    TOPN ( 1, FILTER ( Table1, ISBLANK ( Table1[Error] ) ), Table1[Counter], DESC ),
    Table1[Counter]
)
Measure 2 =
MAXX (
    TOPN ( 1, FILTER ( Table1, ISBLANK ( Table1[Error] ) ), Table1[Counter], DESC ),
    Table1[CreationDate]
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@Ratax,

 

You may use TOPN Function.

Measure =
MAXX (
    TOPN ( 1, FILTER ( Table1, ISBLANK ( Table1[Error] ) ), Table1[Counter], DESC ),
    Table1[Counter]
)
Measure 2 =
MAXX (
    TOPN ( 1, FILTER ( Table1, ISBLANK ( Table1[Error] ) ), Table1[Counter], DESC ),
    Table1[CreationDate]
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @v-chuncz-msft
thanks for the help it's perfectly, except the last one.
I didn't express my self clear enough. 🙂

 

i wanted it to show the last entry in the counter column, regards to date. So we can keep track of the current count of sticks since last error 😄

@Ratax,

 

Just change the third parameter of TOPN Function to Table1[CreationDate].

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors