Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi Everyone,
Here Is one requirement where I want to show the total volume (bar ) in bar and line chart along with all the month on the x axis.
So for that I created one table contains all the month names and one more dec as cumulative as shown in below
But when Im putting the measure it only shows the values for the available month data .I also want to show the Total volume at cumlulative .I tried many times but did not work.
So at total level I want to show the volume as shown in the above SS.
any pssoible way
@amitchandak
Solved! Go to Solution.
Hi, @Shreyash_Sanket
You can use the following dax to achieve your need.
calculate % =
VAR _value1 =
SELECTEDVALUE ( 'Table (2)'[Value1] )
VAR _value2 =
SELECTEDVALUE ( 'Table (2)'[Value2] )
VAR _monthName1 =
SELECTEDVALUE ( 'Table'[MonthName] )
VAR _monthName2 =
SELECTEDVALUE ( 'Table (2)'[Month] )
VAR _subCalculate =
CALCULATE ( 1 - DIVIDE ( _value1, _value2 ) )
VAR _totalValue1 =
SUMX ( ALL ( 'Table (2)' ), 'Table (2)'[Value1] )
VAR _totalValue2 =
SUMX ( ALL ( 'Table (2)' ), 'Table (2)'[Value2] )
VAR _totalCalculate =
CALCULATE ( 1 - DIVIDE ( _totalValue1, _totalValue2 ) )
RETURN
IF (
_monthName2 IN ALLSELECTED ( 'Table'[MonthName] ),
_subCalculate,
IF ( _monthName1 = "Cumulative", _totalCalculate )
)
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, @Shreyash_Sanket
You can use the following dax to achieve your need.
calculate % =
VAR _value1 =
SELECTEDVALUE ( 'Table (2)'[Value1] )
VAR _value2 =
SELECTEDVALUE ( 'Table (2)'[Value2] )
VAR _monthName1 =
SELECTEDVALUE ( 'Table'[MonthName] )
VAR _monthName2 =
SELECTEDVALUE ( 'Table (2)'[Month] )
VAR _subCalculate =
CALCULATE ( 1 - DIVIDE ( _value1, _value2 ) )
VAR _totalValue1 =
SUMX ( ALL ( 'Table (2)' ), 'Table (2)'[Value1] )
VAR _totalValue2 =
SUMX ( ALL ( 'Table (2)' ), 'Table (2)'[Value2] )
VAR _totalCalculate =
CALCULATE ( 1 - DIVIDE ( _totalValue1, _totalValue2 ) )
RETURN
IF (
_monthName2 IN ALLSELECTED ( 'Table'[MonthName] ),
_subCalculate,
IF ( _monthName1 = "Cumulative", _totalCalculate )
)
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
User | Count |
---|---|
85 | |
80 | |
77 | |
49 | |
41 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |