Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have this table below which computes Mode.
I have a calculated column that is essentially a true/false column. I want to compute the mode for each of those choices (the true ones, and the false ones), but based on the measure below. Just adding that column as a slicer or filter on this measure does not work.
Any ideas?
Solved! Go to Solution.
Hi @texmexdragon2 ,
Your measure mainly used a TOPN function, which will return a row in your formula instead of a value.
I create a sample. Single or Bulk is a calculated column according to your description.
In my understanding, you want to use Single or Bulk as a slicer and to calculate the Calculate the ShippedQty with the largest number of rows separately. Modify your formula to:
Mode_ShippedQty =
VAR _T =
TOPN (
1,
ADDCOLUMNS (
VALUES ( ShippedOrders2022_Query[ShippedQty] ),
"Frequency", CALCULATE ( COUNT ( ShippedOrders2022_Query[ShippedQty] ) )
),
[Frequency], 0
)
RETURN
MAXX ( _T, [ShippedQty] )
Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @texmexdragon2 ,
Your measure mainly used a TOPN function, which will return a row in your formula instead of a value.
I create a sample. Single or Bulk is a calculated column according to your description.
In my understanding, you want to use Single or Bulk as a slicer and to calculate the Calculate the ShippedQty with the largest number of rows separately. Modify your formula to:
Mode_ShippedQty =
VAR _T =
TOPN (
1,
ADDCOLUMNS (
VALUES ( ShippedOrders2022_Query[ShippedQty] ),
"Frequency", CALCULATE ( COUNT ( ShippedOrders2022_Query[ShippedQty] ) )
),
[Frequency], 0
)
RETURN
MAXX ( _T, [ShippedQty] )
Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share some data and show the expected result.
please try
@tamerj1 @Ashish_Mathur Below is the calculated column I mentioned.
My desire is to be able to have the mode calculated separately for Bulk or for Single.
So if there are 30 rows. I want to determine what the mode is for all of the rows that are bulk, and all of the rows that are single. So if there was 10 rows for single, and the shipped quantity of "7" occurs on 6 out of 10 rows, then the mode would be 7.
Hi,
Share the download link of the PBI file.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
101 | |
79 | |
73 | |
65 |
User | Count |
---|---|
141 | |
107 | |
100 | |
82 | |
74 |