Forum Discussion

confidentnwrong's avatar
confidentnwrong
Icon for Advocate I rankAdvocate I
3 years ago
Solved

Show progress on a reactive stacked bar chart

Hi everyone !

 

I have a table representing different plants' growth week after week such as :

 

NameSizeDate of measureWeek
A2.5012/06W-1
A2.9019/06W
B1.8014/06W-1
B1.8022/06W
C1.8014/06W-1
D0.5009/06W-2
D0.5012/06W-1

 

The column "Week" is calculated based on the current week (from today to 7 days ago is "W", 7 days before "W-1" and so on). Everything before "W-2" is labeled "W-X".

 

I want to display those values in a bar chart such as :

Which I was able to do using 4 measures, one for each week, like this :

 

W-X = 
CALCULATE(MAX('Fact'[Size]), 'Fact'[Week]="W-X")
W-2 = IF( CALCULATE(MAX('Fact'[Size]), 'Fact'[Week]="W-2") >0,
    CALCULATE(MAX('Fact'[Size]), 'Fact'[Week]="W-2")- [W-X],
    BLANK())

 

Up to W.

I check if the calculation is bigger than 0 because it means that the plant stayed the same size.

 

Then I used a parameter containing my 4 measures that I put on the X-axis of the stacked bar chart.

I added a slicer on the parameter so I could also see only the plants that have grown.

 

Now, my issue is : I would like to see the whole size (rather than only this week's) when I use the slicer.

Re-using the above example, when I press on "W" on the slicer, I only get this :

Which is how much the plant A has grown, but not its full size.

 

How can I get this instead ?

 

Best regards.

  • I think something can be done using the same idea as this post, which uses a measure :
    Solved: Measure to use range slicer which can include blan... - Microsoft Fabric Community

    There would be a parameter based on W to W-X, which checks the value of a column containing the values "Progress for W" to "Progress for W-X", and the parameters excludes the blank values of W when "Progress for W" is selected.

     

    What I have done for now though, which works, is use bookmarks:

    I create a bookmark for each week.

    For the week W, I click "W is not blank" in the filter panel, and I do the same for the other ones.

    Then I select "Navigator" in the button creator dropdown, "bookmark navigator", and my visual works as intended

2 Replies

  • Update : 

     

    I get exactly what I am looking for when I manually filter the visual with "W is not blank".

    I will try to use a new column or bookmarks to achieve my goal. I will update and mark as solution once I've made it work.

     

  • I think something can be done using the same idea as this post, which uses a measure :
    Solved: Measure to use range slicer which can include blan... - Microsoft Fabric Community

    There would be a parameter based on W to W-X, which checks the value of a column containing the values "Progress for W" to "Progress for W-X", and the parameters excludes the blank values of W when "Progress for W" is selected.

     

    What I have done for now though, which works, is use bookmarks:

    I create a bookmark for each week.

    For the week W, I click "W is not blank" in the filter panel, and I do the same for the other ones.

    Then I select "Navigator" in the button creator dropdown, "bookmark navigator", and my visual works as intended