Create a Dax to find source of value while using dependent dax measures in stacked column chart
Hi,
I have a visual as below in my report:
This visual contains a measure called ‘Total switch new’ as below:
Total switch new =
SUMX ( ‘Accruals’, [Switch Units] )
‘Switch Units’ dax referenced above is as below:
Switch Units =
COALESCE (
[Priority 1 units],
[Priority 2 units],
[Priority 3 units],
[Parameter Value units]
)
‘Priority 1 units’,’Priority 2 units’, ‘Priority 3 units’ & ‘Parameter Value units’ used above are all dax and they are:
Priority 1 units =
SWITCH (
SELECTEDVALUE ( ‘Parameter 4′[Parameter Fields] ),
“‘DAX_Units'[Profile units]”, [Profile units],
“‘DAX_Units'[Direct units]”, [Direct units],
“‘DAX_Units'[Target units]”, [Target units],
“‘DAX_Units'[Priority 4]”, [Units Parameter Value]
)
Priority 2 units =
SWITCH (
SELECTEDVALUE ( ‘Parameter 5′[Parameter Fields] ),
“‘DAX_Units'[Profile units]”, [Profile units],
“‘DAX_Units'[Direct units]”, [Direct units],
“‘DAX_Units'[Target units]”, [Target units],
“‘DAX_Units'[Priority 4]”, [Units Parameter Value]
)
Priority 3 units =
SWITCH (
SELECTEDVALUE ( ‘Parameter 6′[Parameter Fields] ),
“‘DAX_Units'[Profile units]”, [Profile units],
“‘DAX_Units'[Direct units]”, [Direct units],
“‘DAX_Units'[Target units]”, [Target units],
“‘DAX_Units'[Priority 4]”, [Units Parameter Value]
)
Parameter Value units comes from Custom Units table
Above ‘Priority 1 units’,’Priority 2 units’, ‘Priority 3 units’ dax measures contains 3 base dax measures as below(i have given only name here and you will find their measures in attached file):
Profile units
Direct units
Target units
We have used 3 field parameter tables(Parameter 4,Parameter 5 & Parameter 6) to be used as a slicer for reporting.
FYR, i have given table format in page 1 which will give you an idea on how above measures are dependent on each other and how field parameters are used.
Now, I need to show in below visual whether their monthly values is made up of/composed of Profile units or Direct units or Target units (in different colors)
For example, month of july, Total switch new dax shows that value 1166 comes from Profile units(refer page 1 in report) & November, Total switch new dax shows value 910 comes from Target.
Then our expected visual would display something like below(different color code to show whether it comes from Profile or Direct or Target):
PFA file here Financial Management -Tanvi Trial – Copy.pbix
Thanks in advance!
Hi, I have a visual as below in my report:This visual contains a measure called ‘Total switch new’ as below:Total switch new =SUMX ( ‘Accruals’, [Switch Units] ) ‘Switch Units’ dax referenced above is as below: Switch Units =COALESCE ([Priority 1 units],[Priority 2 units],[Priority 3 units],[Parameter Value units]) ‘Priority 1 units’,’Priority 2 units’, ‘Priority 3 units’ & ‘Parameter Value units’ used above are all dax and they are:Priority 1 units =SWITCH (SELECTEDVALUE ( ‘Parameter 4′[Parameter Fields] ),”‘DAX_Units'[Profile units]”, [Profile units],”‘DAX_Units'[Direct units]”, [Direct units],”‘DAX_Units'[Target units]”, [Target units],”‘DAX_Units'[Priority 4]”, [Units Parameter Value]) Priority 2 units =SWITCH (SELECTEDVALUE ( ‘Parameter 5′[Parameter Fields] ),”‘DAX_Units'[Profile units]”, [Profile units],”‘DAX_Units'[Direct units]”, [Direct units],”‘DAX_Units'[Target units]”, [Target units],”‘DAX_Units'[Priority 4]”, [Units Parameter Value]) Priority 3 units =SWITCH (SELECTEDVALUE ( ‘Parameter 6′[Parameter Fields] ),”‘DAX_Units'[Profile units]”, [Profile units],”‘DAX_Units'[Direct units]”, [Direct units],”‘DAX_Units'[Target units]”, [Target units],”‘DAX_Units'[Priority 4]”, [Units Parameter Value]) Parameter Value units comes from Custom Units table Above ‘Priority 1 units’,’Priority 2 units’, ‘Priority 3 units’ dax measures contains 3 base dax measures as below(i have given only name here and you will find their measures in attached file):Profile unitsDirect unitsTarget units We have used 3 field parameter tables(Parameter 4,Parameter 5 & Parameter 6) to be used as a slicer for reporting.FYR, i have given table format in page 1 which will give you an idea on how above measures are dependent on each other and how field parameters are used. Now, I need to show in below visual whether their monthly values is made up of/composed of Profile units or Direct units or Target units (in different colors) For example, month of july, Total switch new dax shows that value 1166 comes from Profile units(refer page 1 in report) & November, Total switch new dax shows value 910 comes from Target. Then our expected visual would display something like below(different color code to show whether it comes from Profile or Direct or Target): PFA file here Financial Management -Tanvi Trial – Copy.pbix Thanks in advance!@SergeiBaklan Read More