Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi Team,
I want to create a measure/column, on distinctcount & median together
Eg: created in Excel
Is this possible in power bi.
Regards,
Hari
Solved! Go to Solution.
Hi, @harirao
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create measures as below.
DisctinctCount OId = DISTINCTCOUNT('Table'[OpportunityId])
actual_visibility_weeks measure 1 =
MEDIANX(
DISTINCT('Table'[actual_visibility_weeks]),
'Table'[actual_visibility_weeks]
)
actual_visibility_weeks measure 2 =
IF(
ISFILTERED('Table'[ID]),
SUM('Table'[actual_visibility_weeks]),
MEDIANX(
ALL('Table'),
'Table'[actual_visibility_weeks]
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @harirao
You may create a calculated table as below.
Table 2=
SUMMERIZE(
'Table',
'Table'[subregion],
"Median",
VALUE(MEDIAN('Table'[actual_visibility_weeks]))
)
Here is my data for test.
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @harirao
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create measures as below.
DisctinctCount OId = DISTINCTCOUNT('Table'[OpportunityId])
actual_visibility_weeks measure 1 =
MEDIANX(
DISTINCT('Table'[actual_visibility_weeks]),
'Table'[actual_visibility_weeks]
)
actual_visibility_weeks measure 2 =
IF(
ISFILTERED('Table'[ID]),
SUM('Table'[actual_visibility_weeks]),
MEDIANX(
ALL('Table'),
'Table'[actual_visibility_weeks]
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Allan @v-alq-msft,
Thanks for providing the solution, after creating discount and medianx, need to create a table region wise and include drill down option as mentioned below
please note dashboard will be refreshed every weeks, filter for weekly view.
Regards,
Hari
Hi, @harirao
You may create a calculated table as below.
Table 2=
SUMMERIZE(
'Table',
'Table'[subregion],
"Median",
VALUE(MEDIAN('Table'[actual_visibility_weeks]))
)
Here is my data for test.
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Allan @v-alq-msft,
Thanks for the above solution, by using this i was able to create measure, now i want to include two condition inside the DAX
1st Condition : [actual_visibility_Weeks](>1) should be 1 and above. Highlighted in green
2nd Condition : [actual_visibility_Weeks]=0 & [0 Visibility exclusion] = "No". Should be included in highlighted in red
Median = FORMAT(MEDIANX(
Hi, @harirao
You may create a measure as below.
Measure =
IF(
SELECTEDVALUE('Table'[actual_visibility_weeks])>0,
"green",
IF(
SELECTEDVALUE('Table'[actual_visibility_weeks])=0,
"red"
)
)
Then you can click 'subregion'=>'conditional formatting'=>'background color', set as below.
Result:
Best Regards
Allan
It should be possible. It's hard to be exact with just a screenshot of data, but you should be able to use MEDIANX over the values of the week numbers.
= MEDIANX( values( table[1] ) , [actual_visibility_weeks] )
But I don't really understand what you mean by your comment of needing to consider the opportunityId as your example excel function is only looking at column B. This may change the first parameter of the MEDIANX as this controls the grain at which the median is calculated.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
147 | |
85 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |