Forum Discussion
zebra
Helper II
2 years agoCreate a measure or dynamic virtual table based on slicer selection that returns table
Hi All, Would you please help in following scenario? I have a table that contains ages and city information as follow. I want to create the normal distribution for the age col...
- 2 years ago
zebra
I've adjusted the calculation. Kindly review the attached file. The chart now aligns with Barcelona as expected in your results. I utilized MAX to capture the current value. The choice of MIN, SUM, or AVG would also suffice since we're dealing with a single value. The crucial aspect is employing an aggregation function to obtain the filter context value.Below is the DAX calculation for NORM.DIST. It now specifically takes into account the current selection by using ALLSELECTED.
Norm.Dist = VAR __Mean = CALCULATE( AVERAGE(Sheet1[Age]) , ALLSELECTED( Sheet1 )) VAR __StdDev = CALCULATE( STDEV.S(Sheet1[Age]) , ALLSELECTED( Sheet1 )) VAR __Result = NORM.DIST( AVERAGE( Sheet1[Age]) ,__Mean ,__StdDev,FALSE()) RETURN __Result
HarishKM
Super User
2 years agozebra Hey,
you can try this. NORM.DIST function (DAX) - DAX | Microsoft Learn
and slicer based on measure - What are Field Parameters in Power BI? | phData
Thanks
Harish
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!