How to calculate mode of invoice rates using DAX

Ethan Earle 0 Reputation points
2023-12-04T21:04:37.5666667+00:00

Hi,

Using DAX in Power BI I'm trying to calculate the modal rate using a database of invoice line details where rate multiplied by quantity equals the line total.
I can calculate the modal rate based on line/row entries, in the dataset, but I need to consider the mode based also on the quantity to give me a per unit based result rather than per line.

The line level formula I have is:

= MINX(
		TOPN(1,
				ADDCOLUMNS(
							VALUES(InvoicesandCredits[Rate]),
							"Frequency",
							CALCULATE(COUNT(InvoicesandCredits[Rate]))
							),
				[Frequency],
				0),
		InvoicesandCredits[Rate])

I assume I'm missing something quite simple,
Thanks.

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,681 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emi Zhang-MSFT 23,811 Reputation points Microsoft Vendor
    2023-12-05T01:27:48.28+00:00

    Hi,

    I suggest you post this issue to Power BI forum:

    https://community.fabric.microsoft.com/t5/Forums/ct-p/PBI_Comm_Forums

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments