Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Filter _ slicer _ line chart

  Hi Guys,

having this table:

TitlePeriod Mileage per period
Incident name  11000
Incident name2  11000
Incident name3  21503
Incident name4  31111
Incident name5  44503
Incident name6  44503
Incident name7  44503

 

I need to get column " incident per period value "

 

 " incident per period value " = 1000 / 2

as there are 2 incidents (or 2 rows for  period 1 ) so value is  500 

 

TitlePeriod Mileage per period incident per period value
Incident name  11000500
Incident name2  11000500
Incident name3  215031503
Incident name4  311111111
Incident name5  445031501
Incident name6  445031501
Incident name7  445031501

 

AND

put that into interactive visualisation but with filter on Title.

I want filter on Title that will change values in the graph.

 

As picture shows below:

sonicmaster_1-1640184533181.png

 

after deselection of  "Incident name6" for Period 4 it shows value 3302 

but I would like to see 2251.5 

 

kind of filter doing: 

4503 / 2 = 2251.5

divide 4503 by number of Titles in period 4 BUT without "Incident name6" as it has been deselected on slicer 

Incident name5  4 4503 1501
Incident name6  4 4503 1501
Incident name7  4 4503 1501

 

 

Is it possible in Power bi?

1 ACCEPTED SOLUTION
PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

Calculated columns aren't dynamic in Power BI.  That is, slicer selections do not affect the values in them as they are not recalculated.

Measures are dynamic, so that's what to use.

Here's a measure to get the values.  You may want to think about what value should be displayed at the total level.  That isn't specified in your question

incident per period value = 
VAR _MileagePerPeriod = 
ADDCOLUMNS(
    SUMMARIZE(
        Incidents,
        Incidents[Period],
        Incidents[ Mileage per period]
    ),
    "@Rows", CALCULATE(COUNTROWS(Incidents))
)
VAR _Result = SUMX(_MileagePerPeriod, DIVIDE(Incidents[ Mileage per period], [@Rows]) )
RETURN
    _Result

PaulOlding_0-1640186507676.png

 

View solution in original post

2 REPLIES 2
PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

Calculated columns aren't dynamic in Power BI.  That is, slicer selections do not affect the values in them as they are not recalculated.

Measures are dynamic, so that's what to use.

Here's a measure to get the values.  You may want to think about what value should be displayed at the total level.  That isn't specified in your question

incident per period value = 
VAR _MileagePerPeriod = 
ADDCOLUMNS(
    SUMMARIZE(
        Incidents,
        Incidents[Period],
        Incidents[ Mileage per period]
    ),
    "@Rows", CALCULATE(COUNTROWS(Incidents))
)
VAR _Result = SUMX(_MileagePerPeriod, DIVIDE(Incidents[ Mileage per period], [@Rows]) )
RETURN
    _Result

PaulOlding_0-1640186507676.png

 

smpa01
Super User
Super User

@Anonymous  this wil do the trick; pbix is atatched

 

Measure =
DIVIDE (
    CALCULATE ( MAX ( tbl[ Mileage per period] ), ALLEXCEPT ( tbl, tbl[Period] ) ),
    CALCULATE ( COUNT ( tbl[Period] ), ALLEXCEPT ( tbl, tbl[Period] ) )
)

 

 

smpa01_0-1640185578414.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors