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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Bstylee470
Frequent Visitor

Date of Max Transactions

Hello Power BI community,

I have an interesting formula that I'm trying to write. So we deal with daily transactions and have a model in Analysis Services that we get our data from. We were trying to figure out what our max transactions were for a given day of the week. The following DAX gives that information perfectly.

 

Max transactions per Day =
MAXX(
KEEPFILTERS(VALUES('Period Daily'[Day Date])),
CALCULATE([Total Transaction Count])
)

 

I take that and put it on a visual with Day of Week from our Period Dimension and we get:

 

power bi max transactions date.PNG

 

Now I would like to be able to display what date these transactions occured on and I am stumped. I could think of a way to do it in Tableau with LOD calcs, but I need to be able to use this in Power BI. 

Any help would be greatly appreciated.

4 REPLIES 4
OwenAuger
Super User
Super User

@Bstylee470

 

You can use a measure like this to get the date with max transactions:

 

 

Date with Max Transactions =
FIRSTNONBLANK (
    TOPN (
        1,
        KEEPFILTERS ( VALUES ( 'Period Daily'[Day Date] ) ),
        [Total Transaction Count]
    ),
    0
)

There is an article containing this pattern here.

 

I left in the KEEPFILTERS as I assume if it was required in the context in which you use your original measure, it may be required here as well.

 

Regards,

Owen

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn
Stachu
Community Champion
Community Champion

how is the [Total Toll Count]) measure calculated?
if I understand the logic correctly - 179786 for Sunday means that out of many sundays there was one with this many transactions, correct?
If so somehing with LOOKUPVALUE may work



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

It is a measure in our transaction table. Sorry does that answer the question?

Hi @Bstylee470,

 

I think @Stachu was asking for the formula of the [Total Toll Count] measure. And for his second question, 79786 for Sunday means that out of many sundays there was one with this many transactions. Is this right?

 

Also if it is possible, please share us your pbix file with One Drive or Google Drive. So that we can know your actual situation and make some tests. If you can't, please share us some sample data which can help us repro your issue.

 

Thanks,
Xi Jin.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.