Forum Discussion
Help With Waterfall Visual
- 10 months ago
Hi @shahrukhgaffar0,
Based on your requirement, you need to manipulate the Start and End values for each bar in your calculated table. Specifically for all bars except Target, the waterfall logic should be cumulative.
For the 'Target' bar, you need to override the cumulative logic and set Start = 0 and End = Target Value.
You can modify your calculated table to include StartValue and EndValue columns.
Use this updated DAX:
WaterFall Data Table = VAR YTD_Table = ADDCOLUMNS( SELECTCOLUMNS( ROW("Category", "YTD Revenue", "Amount", [1.2.Cumulative Closed Sales]), "Category", [Category], "Amount", [Amount] ), "StartValue", 0, "EndValue", [Amount] ) VAR NORMALISED_SALES = ADDCOLUMNS( SUMMARIZE( FILTER( 'Sales Data', 'Sales Data'[Stage] IN { "4.Submitted Proposal", "5.Tender Evaluation", "6.Negotiations", "7.Verbal Award" } ), 'Sales Data'[Opportunity Name] ), "Category", 'Sales Data'[Opportunity Name], "Amount", CALCULATE( [WaterFall Norm Sales], 'Sales Data'[Opportunity Name] = EARLIER('Sales Data'[Opportunity Name]) ) ) VAR Normalised_Sales_Final = ADDCOLUMNS( SELECTCOLUMNS(NORMALISED_SALES, "Category", [Category], "Amount", [Amount]), "StartValue", BLANK(), // Will be calculated in visuals "EndValue", [Amount] ) VAR VARIENCE = ADDCOLUMNS( SELECTCOLUMNS( ROW("Category", "Variance", "Amount", [Variance]), "Category", [Category], "Amount", [Amount] ), "StartValue", BLANK(), "EndValue", [Amount] ) VAR TARGET_VALUE = ADDCOLUMNS( SELECTCOLUMNS( ROW("Category", "Target", "Amount", [3.2.Cumulative Target Sales]), "Category", [Category], "Amount", [Amount] ), "StartValue", 0, // Force start from zero "EndValue", [Amount] ) RETURN UNION( YTD_Table, Normalised_Sales_Final, VARIENCE, TARGET_VALUE )Thanks and regards,
Anjan Kumar Chippa
Hi shahrukhgaffar0,
Thank you for reaching out to Microsoft Fabric Community.
Thank you DataNinja777 for the prompt response.
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the user for the issue worked? or let us know if you need any further assistance.
Thanks and regards,
Anjan Kumar Chippa
Hi @shahrukhgaffar0,
Based on your requirement, you need to manipulate the Start and End values for each bar in your calculated table. Specifically for all bars except Target, the waterfall logic should be cumulative.
For the 'Target' bar, you need to override the cumulative logic and set Start = 0 and End = Target Value.
You can modify your calculated table to include StartValue and EndValue columns.
Use this updated DAX:
WaterFall Data Table =
VAR YTD_Table =
ADDCOLUMNS(
SELECTCOLUMNS(
ROW("Category", "YTD Revenue", "Amount", [1.2.Cumulative Closed Sales]),
"Category", [Category],
"Amount", [Amount]
),
"StartValue", 0,
"EndValue", [Amount]
)
VAR NORMALISED_SALES =
ADDCOLUMNS(
SUMMARIZE(
FILTER(
'Sales Data',
'Sales Data'[Stage] IN {
"4.Submitted Proposal",
"5.Tender Evaluation",
"6.Negotiations",
"7.Verbal Award"
}
),
'Sales Data'[Opportunity Name]
),
"Category", 'Sales Data'[Opportunity Name],
"Amount", CALCULATE(
[WaterFall Norm Sales],
'Sales Data'[Opportunity Name] = EARLIER('Sales Data'[Opportunity Name])
)
)
VAR Normalised_Sales_Final =
ADDCOLUMNS(
SELECTCOLUMNS(NORMALISED_SALES, "Category", [Category], "Amount", [Amount]),
"StartValue", BLANK(), // Will be calculated in visuals
"EndValue", [Amount]
)
VAR VARIENCE =
ADDCOLUMNS(
SELECTCOLUMNS(
ROW("Category", "Variance", "Amount", [Variance]),
"Category", [Category],
"Amount", [Amount]
),
"StartValue", BLANK(),
"EndValue", [Amount]
)
VAR TARGET_VALUE =
ADDCOLUMNS(
SELECTCOLUMNS(
ROW("Category", "Target", "Amount", [3.2.Cumulative Target Sales]),
"Category", [Category],
"Amount", [Amount]
),
"StartValue", 0, // Force start from zero
"EndValue", [Amount]
)
RETURN
UNION(
YTD_Table,
Normalised_Sales_Final,
VARIENCE,
TARGET_VALUE
)
Thanks and regards,
Anjan Kumar Chippa
- v-achippa9 months agoCommunity Support
Hi @shahrukhgaffar0,
We wanted to kindly follow up to check if the solution I have provided for the issue worked? or let us know if you need any further assistance.
Thanks and regards,
Anjan Kumar Chippa