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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Fantmas
Helper III
Helper III

Create Waterfall Chart with breakdown based on date Selected value

Hi all,

 

I am new in the PowerBi journey, I am trying to create a waterfall that display movement from based on a date value in a slicer,

 

in my measure I got the following error message and I am stuck to fix it, can you help me :

Fantmas_0-1661705652218.png


below the measure



FTE variance by MONTH = 

var selectedMonth = SELECTEDVALUE('Period Available'[Period])
var selectedOMTYPE = SELECTEDVALUE(DIMBRIDGE[OM TYPE (FTE BRIDGE)])

return
            SWITCH(selectedMonth,
                SELECTEDVALUE(DimDate[EndMonth]),
                    SWITCH(selectedOMTYPE,
                        "1. HIRING / REHIRING", [1. HIRING / REHIRING],
                        "2. CHANGE IN THE CONTRACT TYPE", [2. CHANGE IN THE CONTRACT TYPE],
                        "3. CHANGE IN ACTUAL WORK % (FTE CHANGE)", [3. CHANGE IN ACTUAL WORK % (FTE CHANGE)],
                        "4. BACK FROM HOLD", [4. BACK FROM HOLD],
                        "6. INTERIM IN", [6. INTERIM IN],
                        "9. ONLY WS CHANGE IN", [9. ONLY WS CHANGE IN],
                        "9.  TECH UNEXPLAINED", [9. TECH UNEXPLAINED],
                        "A. DEPARTURE", [A. DEPARTURE],
                        "B. CHANGE IN THE CONTRACT TYPE", 0,
                        "C. CHANGE IN ACTUAL WORK % (FTE CHANGE)", 0,
                        "D. ON HOLD", 0,
                        "F. INTERIM OUT", 0,
                        "X. ONLY WS CHANGE IN", 0,
                        "I.  TECH UNEXPLAINED", 0,
                        [FTE M]
                        ),
                EOMONTH(SELECTEDVALUE(DimDate[EndMonth]),-1),
                    SWITCH(selectedOMTYPE,
                        "1. HIRING / REHIRING", 0,
                        "2. CHANGE IN THE CONTRACT TYPE", 0,
                        "3. CHANGE IN ACTUAL WORK % (FTE CHANGE)", 0,
                        "4. BACK FROM HOLD", 0,
                        "6. INTERIM IN", 0,
                        "9. ONLY WS CHANGE IN", 0,
                        "9.  TECH UNEXPLAINED", 0,
                        "A. DEPARTURE", -1*[A. DEPARTURE],
                        "B. CHANGE IN THE CONTRACT TYPE", -1*[B. CHANGE IN THE CONTRACT TYPE],
                        "C. CHANGE IN ACTUAL WORK % (FTE CHANGE)", -1*[C. CHANGE IN ACTUAL WORK % (FTE CHANGE)],
                        "D. ON HOLD", -1*[D. ON HOLD],
                        "F. INTERIM OUT", -1*[F. INTERIM OUT],
                        "X. ONLY WS CHANGE IN", -1*[X. ONLY WS CHANGE OUT],
                        "I.  TECH UNEXPLAINED", -1*[I. TECH UNEXPLAINED],
                        [FTE M-1])
            )

 

1 ACCEPTED SOLUTION
Fantmas
Helper III
Helper III

Hi,

Thank you for your feedback, it sems working now,

I amr requesting a last support from powerBi community , I Try get the sum of previous month value based on Slicer selection my code return me blank and I do not understand why :



 

M-1 = Calculate( [FTE MTD], REMOVEFILTERS( DimDate[Date] ), 'Fact FTE'[Period Available] = EOMONTH( SELECTEDVALUE(DimDate[Date]),-1))

 

Fantmas_0-1662049671279.png

 

 

View solution in original post

4 REPLIES 4
Fantmas
Helper III
Helper III

Hi,

Thank you for your feedback, it sems working now,

I amr requesting a last support from powerBi community , I Try get the sum of previous month value based on Slicer selection my code return me blank and I do not understand why :



 

M-1 = Calculate( [FTE MTD], REMOVEFILTERS( DimDate[Date] ), 'Fact FTE'[Period Available] = EOMONTH( SELECTEDVALUE(DimDate[Date]),-1))

 

Fantmas_0-1662049671279.png

 

 

amitchandak
Super User
Super User

@Fantmas , Try like

 

FTE variance by MONTH =

var selectedMonth = SELECTEDVALUE('Period Available'[Period])
var selectedOMTYPE = SELECTEDVALUE(DIMBRIDGE[OM TYPE (FTE BRIDGE)])

return
SWITCH(True() ,
selectedMonth =SELECTEDVALUE(DimDate[EndMonth]),
SWITCH(selectedOMTYPE,
"1. HIRING / REHIRING", [1. HIRING / REHIRING],
"2. CHANGE IN THE CONTRACT TYPE", [2. CHANGE IN THE CONTRACT TYPE],
"3. CHANGE IN ACTUAL WORK % (FTE CHANGE)", [3. CHANGE IN ACTUAL WORK % (FTE CHANGE)],
"4. BACK FROM HOLD", [4. BACK FROM HOLD],
"6. INTERIM IN", [6. INTERIM IN],
"9. ONLY WS CHANGE IN", [9. ONLY WS CHANGE IN],
"9. TECH UNEXPLAINED", [9. TECH UNEXPLAINED],
"A. DEPARTURE", [A. DEPARTURE],
"B. CHANGE IN THE CONTRACT TYPE", 0,
"C. CHANGE IN ACTUAL WORK % (FTE CHANGE)", 0,
"D. ON HOLD", 0,
"F. INTERIM OUT", 0,
"X. ONLY WS CHANGE IN", 0,
"I. TECH UNEXPLAINED", 0,
[FTE M]
),
selectedMonth = EOMONTH(SELECTEDVALUE(DimDate[EndMonth]),-1),
SWITCH(selectedOMTYPE,
"1. HIRING / REHIRING", 0,
"2. CHANGE IN THE CONTRACT TYPE", 0,
"3. CHANGE IN ACTUAL WORK % (FTE CHANGE)", 0,
"4. BACK FROM HOLD", 0,
"6. INTERIM IN", 0,
"9. ONLY WS CHANGE IN", 0,
"9. TECH UNEXPLAINED", 0,
"A. DEPARTURE", -1*[A. DEPARTURE],
"B. CHANGE IN THE CONTRACT TYPE", -1*[B. CHANGE IN THE CONTRACT TYPE],
"C. CHANGE IN ACTUAL WORK % (FTE CHANGE)", -1*[C. CHANGE IN ACTUAL WORK % (FTE CHANGE)],
"D. ON HOLD", -1*[D. ON HOLD],
"F. INTERIM OUT", -1*[F. INTERIM OUT],
"X. ONLY WS CHANGE IN", -1*[X. ONLY WS CHANGE OUT],
"I. TECH UNEXPLAINED", -1*[I. TECH UNEXPLAINED],
[FTE M-1])
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

it seems working now, I have an additional question, is it possible to do a dynamic title for the category,

When the user select the date he want to see, the column title will change depending of the selected date ?

Thank a lot for your support

Regards


Hi @Fantmas ,

 

Maybe you can use drill down function to do a dynamic title for the category.

vyadongfmsft_0-1661940154360.png

 

When you drill down, the column title will change depending of the selected date.

vyadongfmsft_1-1661940154364.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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