User Profile
hbins181
New Member
Joined 2 years ago
User Widgets
Contributions
Re: Calculate Measure base on filter selection
The way I did it was a bit different, I needed a Selection Slicer to Determine which Lines to draw in a LineGraph. I drew one line in the Main Y-Axis and the second line in the Secondary Y-Axis. If there is no selection, blank graph. If "All" is selected it shows both. 1. I first created a custom column with the values I am filtering by (In my case it was Density and Sulphur Values) 2. (OPTIONAL) Add an All value in custom column if you desire to show all option 3. Create a first measure - My Example: SulphurMeasure = VAR Density_Values = SUM(Hardisty[Absolute Density (kg/m3)]) //Line Value1 VAR Sulphur_Values = SUM(Hardisty[Sulphur (wt%)]) //Line Value2 VAR SELECTION = SWITCH ( SELECTEDVALUE(Toggle[Toggle]), //Finds the selected value. Toggle[Toggle] is what I am using to filter BLANK(), BLANK(), //If blank print blank (OPTIONAL) "Sulphur (wt%)", Sulphur_Values, //If Sulphur, draw sulphur line "ALL", Sulphur_Values // If All, draw sulphur line (OPTIONAL) ) RETURN SELECTION 4. Create a second measure - Basically same but opposite - My Example: DensityMeasure = VAR Density_Values = SUM(Hardisty[Absolute Density (kg/m3)]) //Line Data1 VAR Sulphur_Values = SUM(Hardisty[Sulphur (wt%)]) //Line Data2 VAR SELECTION = SWITCH ( SELECTEDVALUE(Toggle[Toggle]), //The currently selected value in filter BLANK(), BLANK(), //If nothing selected show nothing (OPTIONAL) "Absolute Density (kg/m3)", Density_Values, //If Density, draw density "ALL", Density_Values //If All, draw density (OPTIONAL) ) RETURN SELECTION 5. After you've created the measures, Apply them to the graph, (y-axis & secondary y-axis) 6. Create a Slicer using the custom column from Step 1 Hope this helps! Hasan B3.8KViews0likes0Comments
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.