Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All,
I want to create a WaterFall Visual But Some Conditions i Want in it
This is My Target Visual That i need to be
and Below is my Power BI visual
Condition
YTD Sales will be 1st Bar
2nd Last Will Be Variance
and Last will be Target Value
I have Created a Calculated Table With Index
now i am Stuck to Replicate the Same Visual
Solved! Go to Solution.
You can force that exact order (YTD first → drivers → Variance (2nd last) → Target (last)) with a disconnected steps table and one measure that returns the amount for the currently selected step.
Create a calculated table:
Waterfall Steps =
DATATABLE(
"Step", STRING,
"Order", INTEGER,
"Type", STRING, -- helps with colors/“Set as total”
{
{"YTD Sales", 1, "Total"},
{"Driver A", 2, "Driver"},
{"Driver B", 3, "Driver"},
{"Driver C", 4, "Driver"},
{"Variance", 999,"Variance"},
{"Target", 1000,"Total"}
})
Sort [Step] by [Order].
(Replace Driver A/B/C with your real drivers; add/remove rows as needed.)
[Sales YTD] := /* your YTD measure */
[Target Value]:= /* your target measure */
/* One driver amount measure that returns value for a single category
in your fact table (adjust table/column names & logic) */
[Driver Amount] :=
VAR cat = SELECTEDVALUE ( 'Waterfall Steps'[Step] )
RETURN
CALCULATE ( [Base Amount],
TREATAS ( { cat }, 'Fact'[Category] ) )
[Sum Drivers] :=
SUMX (
FILTER ( ALL ( 'Waterfall Steps' ), 'Waterfall Steps'[Type] = "Driver" ),
CALCULATE (
[Base Amount],
TREATAS ( { 'Waterfall Steps'[Step] }, 'Fact'[Category] )
)
)
Base Amount should be the measure that produces each driver’s signed contribution. If your drivers come from different rules, create separate measures and sum them here instead.
[Waterfall Amount] :=
SWITCH (
TRUE(),
SELECTEDVALUE('Waterfall Steps'[Step]) = "YTD Sales", [Sales YTD],
SELECTEDVALUE('Waterfall Steps'[Step]) = "Target", [Target Value],
SELECTEDVALUE('Waterfall Steps'[Step]) = "Variance",
[Target Value] - [Sales YTD] - [Sum Drivers],
/* otherwise it's a driver step */
[Driver Amount]
)
This pattern guarantees:
If you share your driver logic/columns, I can plug them straight into the [Driver Amount] and [Sum Drivers] pieces for you.
I hope it will help you.
May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.
Thank you
Hi @shahrukhgaffar0,
We would like to confirm if our community members answer resolves your query or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are happy to help you.
@Ilgar_Zarbali & @Nasif_Azam ,Thanks for your prompt response
Thank you for your patience and look forward to hearing from you.
Best Regards,
Prashanth Are
MS Fabric community support
You can force that exact order (YTD first → drivers → Variance (2nd last) → Target (last)) with a disconnected steps table and one measure that returns the amount for the currently selected step.
Create a calculated table:
Waterfall Steps =
DATATABLE(
"Step", STRING,
"Order", INTEGER,
"Type", STRING, -- helps with colors/“Set as total”
{
{"YTD Sales", 1, "Total"},
{"Driver A", 2, "Driver"},
{"Driver B", 3, "Driver"},
{"Driver C", 4, "Driver"},
{"Variance", 999,"Variance"},
{"Target", 1000,"Total"}
})
Sort [Step] by [Order].
(Replace Driver A/B/C with your real drivers; add/remove rows as needed.)
[Sales YTD] := /* your YTD measure */
[Target Value]:= /* your target measure */
/* One driver amount measure that returns value for a single category
in your fact table (adjust table/column names & logic) */
[Driver Amount] :=
VAR cat = SELECTEDVALUE ( 'Waterfall Steps'[Step] )
RETURN
CALCULATE ( [Base Amount],
TREATAS ( { cat }, 'Fact'[Category] ) )
[Sum Drivers] :=
SUMX (
FILTER ( ALL ( 'Waterfall Steps' ), 'Waterfall Steps'[Type] = "Driver" ),
CALCULATE (
[Base Amount],
TREATAS ( { 'Waterfall Steps'[Step] }, 'Fact'[Category] )
)
)
Base Amount should be the measure that produces each driver’s signed contribution. If your drivers come from different rules, create separate measures and sum them here instead.
[Waterfall Amount] :=
SWITCH (
TRUE(),
SELECTEDVALUE('Waterfall Steps'[Step]) = "YTD Sales", [Sales YTD],
SELECTEDVALUE('Waterfall Steps'[Step]) = "Target", [Target Value],
SELECTEDVALUE('Waterfall Steps'[Step]) = "Variance",
[Target Value] - [Sales YTD] - [Sum Drivers],
/* otherwise it's a driver step */
[Driver Amount]
)
This pattern guarantees:
If you share your driver logic/columns, I can plug them straight into the [Driver Amount] and [Sum Drivers] pieces for you.
I hope it will help you.
Hey @shahrukhgaffar0 ,
To work with waterfall visual you have to do some pre-works:
1) Create a Helper Table with your preference.
2) Create a DAX Measure with will be sent to the Y-Axis. (e.g. YTD Sales, Variance, Target Value, Cumulative Value)
Cumulative Total =
IF(
VALUES('HelperWaterfall'[IsStart]) = TRUE(),
0,
CALCULATE(
SUM('HelperWaterfall'[Value]),
FILTER(
ALL('HelperWaterfall'),
'HelperWaterfall'[Step] <= MAX('HelperWaterfall'[Step])
)
)
)
3) Build the Waterfall Chart
Highly suggestion you to follow the forum:
Waterfall chart with multiple measures
Best Regards,
Nasif Azam