Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Community,
I created a bar chart with a total column.
The goal is, to have just one total column that shows the summarization of all selected years. The Selection is a slicer.
I have the following DAX formula:
Do you have any idea how to reach this goal?
Thank you
Solved! Go to Solution.
Hi @bedata1 ,
You can update the formula of measure [Total_Sales_Chart] as below to get it:
Total_Sales_Chart =
VAR _selmonth =
SELECTEDVALUE ( Month_Name[Month_Name] )
VAR _selyear =
SELECTEDVALUE ( 'Date'[Year] )
VAR total_ =
CALCULATE (
[Total_Sales],
REMOVEFILTERS ( Month_Name ),
REMOVEFILTERS ( 'Date'[Year] )
)
VAR maxSelectedYear =
CALCULATE ( MAX ( 'Date'[Year] ), ALL ( 'Date' ) )
RETURN
IF (
_selmonth = "Total",
IF ( _selyear = maxSelectedYear, total_, BLANK () ),
[Total_Sales]
)
If the above ones can't help you figure out, please provide some raw data in your tables(exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @bedata1 ,
You can update the formula of measure [Total_Sales_Chart] as below to get it:
Total_Sales_Chart =
VAR _selmonth =
SELECTEDVALUE ( Month_Name[Month_Name] )
VAR _selyear =
SELECTEDVALUE ( 'Date'[Year] )
VAR total_ =
CALCULATE (
[Total_Sales],
REMOVEFILTERS ( Month_Name ),
REMOVEFILTERS ( 'Date'[Year] )
)
VAR maxSelectedYear =
CALCULATE ( MAX ( 'Date'[Year] ), ALL ( 'Date' ) )
RETURN
IF (
_selmonth = "Total",
IF ( _selyear = maxSelectedYear, total_, BLANK () ),
[Total_Sales]
)
If the above ones can't help you figure out, please provide some raw data in your tables(exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
6 |