Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Okay so I shamelessly copy and pasted a DAX formula into my project and it worked. But I also want to understand how it works so please help a guy out!
Basically the measures are for a Top N slicer slider. So first, I have this measure and note that TopN table just consists of the numbers from 2 to 20 (increment by 2)
And then I have this measure next for what I assume to be the ranking obviously but I dont understand how it works
Lastly is this measure and this is the measure that I will put as a visual level filter and set it to CategoryInclude is 1 in the filter pane
I have a vague idea of how it all works but the HASONEVALUE is the thing that's making me confused and I would greatly appreciate if someone can help me understand all these!
Thank you!
Solved! Go to Solution.
Hi @RingoSun ,
Looking at the code basically you have the following setup:
@RingoSun wrote:
In this metric you are checking if there is one value selected on the TOPN table, if you have more than one value selected this metric returns false, so when you have one value of the topN you return that value, if you have more than one you return 10.
@RingoSun wrote:
On this second measure you do the same thing so check if there is a single category select and if that is true you return the ranking of sales based on the category
@RingoSun wrote:
On this last measure you check if the Categoryrank is lower or equal to the TOPN number, so basically if the Ranking is lower or equal than your TOPN you get a value of 1 otherwise you get a value of 0 when you filter based on the 1 your visualization only presents the values that are lower than the SelectedTopNumber
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @RingoSun ,
Looking at the code basically you have the following setup:
@RingoSun wrote:
In this metric you are checking if there is one value selected on the TOPN table, if you have more than one value selected this metric returns false, so when you have one value of the topN you return that value, if you have more than one you return 10.
@RingoSun wrote:
On this second measure you do the same thing so check if there is a single category select and if that is true you return the ranking of sales based on the category
@RingoSun wrote:
On this last measure you check if the Categoryrank is lower or equal to the TOPN number, so basically if the Ranking is lower or equal than your TOPN you get a value of 1 otherwise you get a value of 0 when you filter based on the 1 your visualization only presents the values that are lower than the SelectedTopNumber
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMarch 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
89 | |
77 | |
62 | |
47 | |
39 |
User | Count |
---|---|
118 | |
85 | |
81 | |
58 | |
39 |