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.
Dear All,
I would need your help for the following topic.
I have the a table:
In this table i have two columns.
But my goal would be to have only one column and I would like to change with the slicer what I would like to see, Gross or Net.
Thank you for your support.
BR
Feri
Solved! Go to Solution.
Hi @viferenc,
Create a table with the values:
Gross
Net
(I named the table and the column slicer but you can call what you want)
Add a slicer with the previous table and then in your sales table add this measure and add it to your visual:
Total_Sales = SWITCH( COUNT(Slicer[Slicer])=1, CONTAINS(Slicer,Slicer[Slicer],"Gross"), SUM(Sales[Gross]), CONTAINS(Slicer,Slicer[Slicer],"Net"), SUM(Sales[Net]), 0)
What this does is count the number of values selected in the Slicer and if it's only one it selects the NET or Gross column if it's more than one it give you 0, if you want it to give always by default the Gross Sales for instance change it to:
Total_Sales = SWITCH( TRUE(), CONTAINS(Slicer,Slicer[Slicer],"Gross"), SUM(Sales[Gross]), CONTAINS(Slicer,Slicer[Slicer],"Net"), SUM(Sales[Net]), 0)
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @viferenc,
Create a table with the values:
Gross
Net
(I named the table and the column slicer but you can call what you want)
Add a slicer with the previous table and then in your sales table add this measure and add it to your visual:
Total_Sales = SWITCH( COUNT(Slicer[Slicer])=1, CONTAINS(Slicer,Slicer[Slicer],"Gross"), SUM(Sales[Gross]), CONTAINS(Slicer,Slicer[Slicer],"Net"), SUM(Sales[Net]), 0)
What this does is count the number of values selected in the Slicer and if it's only one it selects the NET or Gross column if it's more than one it give you 0, if you want it to give always by default the Gross Sales for instance change it to:
Total_Sales = SWITCH( TRUE(), CONTAINS(Slicer,Slicer[Slicer],"Gross"), SUM(Sales[Gross]), CONTAINS(Slicer,Slicer[Slicer],"Net"), SUM(Sales[Net]), 0)
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHello -
1. Am I supposed to create an actual data table in the "Data" module, or a table visualization in the "Report" module?
2. If the latter, how do I name a table visualization?
3. How do I name a slicer?
4. Does this solution suffice if I am interested in Gross/Net views for more than just one field (i.e., not just Gross/Net Sales, but also maybe Gross/Net _____)?
Thanks!
Thank you very much
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 |
---|---|
114 | |
101 | |
78 | |
75 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |