Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Team,
DAX -->
I have monthwise Bar chart in that need to add last Bar for Total sum.
Thanks,
Kv
Solved! Go to Solution.
Hi,
I suggest having an additional axis table like below.
I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
All measures are in the attached pbix file.
I hope the below DAXs for creating an axis table and a measure provide ideas in order to create the solution for your data model.
Axis table month =
UNION (
SUMMARIZE ( 'Calendar', 'Calendar'[Month & Year], 'Calendar'[End of Month] ),
ROW (
"columnA", "Total",
"columnB", MAXX ( 'Calendar', 'Calendar'[End of Month] + 1 )
)
)
Value total measure: =
SWITCH (
SELECTEDVALUE ( 'Axis table month'[Month & Year] ),
"Total", SUM ( Data[Value] ),
CALCULATE (
SUM ( Data[Value] ),
TREATAS (
VALUES ( 'Axis table month'[Month & Year] ),
'Calendar'[Month & Year]
)
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi @Anonymous,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
@Anonymous ,
you can also try to create a table with the below code and use it in bar chart,
New Bar Table =
VAR _total= SUMMARIZECOLUMNS('Table'[Month],"1",SUM('Table'[Value]))
VAR _columns= SELECTCOLUMNS(_total,"Month","Total","Value",[1])
return
UNION('Table',_columns)
Thanks,
Arul
Hi,
I suggest having an additional axis table like below.
I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
All measures are in the attached pbix file.
I hope the below DAXs for creating an axis table and a measure provide ideas in order to create the solution for your data model.
Axis table month =
UNION (
SUMMARIZE ( 'Calendar', 'Calendar'[Month & Year], 'Calendar'[End of Month] ),
ROW (
"columnA", "Total",
"columnB", MAXX ( 'Calendar', 'Calendar'[End of Month] + 1 )
)
)
Value total measure: =
SWITCH (
SELECTEDVALUE ( 'Axis table month'[Month & Year] ),
"Total", SUM ( Data[Value] ),
CALCULATE (
SUM ( Data[Value] ),
TREATAS (
VALUES ( 'Axis table month'[Month & Year] ),
'Calendar'[Month & Year]
)
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |