Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi,
So I have some selection buttons created from a switch statement in my report. The statement I have used is the following;
Selection =
SWITCH( TRUE(),
VALUES( 'Metric Selection'[Metric] ) = "Quality", Quality[TotalAvgQualityperAgents],
VALUES( 'Metric Selection'[Metric] ) = "PCS", PCS[TotalAvgPCSperAgent],
VALUES( 'Metric Selection'[Metric] ) = "Sales", Sales[TotalSales],
0)
So in a line chart I have this 'Selection' measure in the values section. This selection button works great when either one of the 'Quality', 'PCS' or 'Sales' button is selected individualy, and updates the chart accordingly. However I need to add a sepereate 'All' button that will update the chart and display all values (individual lines) on the single line chart.
Is there any mdifications I can add to the switch statement that will permit this? What I want to avoid is values of each measure to be summed up together into one line one the chart.
Any advice would be very much appreciated. Let me know if any further clarification is required.
Thanks
Solved! Go to Solution.
MeasureQuality = IF(Selected value('Metric selection'[Metric]="ALL"); Quality[TotalAvgQualityperAgent];
Blank()
)
Then include an "ALL" button aswell?
I dont know if this will work but you could try something like this:
MeasureQuality = IF(Selected value('Metric selection'[Metric]); Blank(); Quality[TotalAvgQualityperAgent] )
This should return blank() if metric selection is filtered and otherwise show the Quality value.
Create one measure for each value and include them in the linechart.
Br,
J
Thank you. This logically sounds promising. However I am receiving error when adding both to the values pane;
Ive tried changing the blank() to 0 but this still prompts same error. Any ideas?
MeasureQuality = IF(Selected value('Metric selection'[Metric]<>Blank()); Blank(); Quality[TotalAvgQualityperAgent] )
Try this! 🙂
Jesus, im not paying attention... like this instead:
MeasureQuality = IF(Selected value('Metric selection'[Metric])<>Blank(); Blank(); Quality[TotalAvgQualityperAgent] )
lol yep I did sus it, hence I deleted my post.
So looks like it tries to pass in multple values from 'Selection' when not choosing anything. See below;
I would have thought this would default to 0 if no value/selection was chosen as per my switch statement above. Any ideas?
(btw thanks for all your help thus far)
MeasureQuality = IF(Selected value('Metric selection'[Metric]="ALL"); Quality[TotalAvgQualityperAgent];
Blank()
)
Then include an "ALL" button aswell?
Brilliant, that did the trick. Thank you very much
Hi @rax99,
Unfortunately, it is really impossible to meet your requirement and there is no proper way to work around. As the measure cannot be treated as category, so we cannot display all values in individual lines, and they will be summed up by default.
Regards,
Frank
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
112 | |
105 | |
94 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |