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 everyone
hope you are healthy
i've problem to comparing actual monthly vs actual daily in 1 chart.
is it possible to make 1 chart with a combination of monthly and daily?
Solved! Go to Solution.
Hi,
Please check the attached pbix file.
I created a new Axis table, and applied the below measure.
Qty total expected result: =
VAR _currentmonthend =
MAX ( 'Calendar'[Date] )
VAR _previousmonthend =
EOMONTH ( _currentmonthend, -1 )
RETURN
SWITCH (
TRUE (),
SELECTEDVALUE ( 'Axis table'[Monthkey] ) = _previousmonthend,
CALCULATE (
SUM ( Data[Quantity] ),
FILTER ( ALL ( 'Calendar' ), 'Calendar'[End of Month] = _previousmonthend )
),
CALCULATE (
SUM ( Data[Quantity] ),
KEEPFILTERS (
FILTER (
ALL ( 'Calendar'[Date] ),
'Calendar'[Date] = MAX ( 'Axis table'[Datekey] )
)
)
)
)
Hi @Anonymous
I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.
If you need more help, please let me know.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
awesome Kim,
thanks for help me
but if I use this code - SELECTEDVALUE ( 'Axis create'[Required axis] ) = "January" -the report it can be static. what if the month changes (Jan to Feb, Feb to Mar, Mar to Apr etc)? can I use code previous month Kim?
Hi,
Thank you for your feedback.
May I ask how the current month is selected on the report page? Is it selected by a slicer selection on the report page? Or, do you want to show all months and dates on one visualization?
Or, please share your sample pbix file's link here, and then I can try to come up with a more accurate solution.
Thanks.
May I ask how the current month is selected on the report page?
only two months, in chart I want to show previous month (month to date) and current month (daily)
Is it selected by a slicer selection on the report page?
yes Kim, for current month I want to choose the date I like
do you want to show all months and dates on one visualization?
only prev month and daily current month
Hi,
Please check the attached pbix file.
I created a new Axis table, and applied the below measure.
Qty total expected result: =
VAR _currentmonthend =
MAX ( 'Calendar'[Date] )
VAR _previousmonthend =
EOMONTH ( _currentmonthend, -1 )
RETURN
SWITCH (
TRUE (),
SELECTEDVALUE ( 'Axis table'[Monthkey] ) = _previousmonthend,
CALCULATE (
SUM ( Data[Quantity] ),
FILTER ( ALL ( 'Calendar' ), 'Calendar'[End of Month] = _previousmonthend )
),
CALCULATE (
SUM ( Data[Quantity] ),
KEEPFILTERS (
FILTER (
ALL ( 'Calendar'[Date] ),
'Calendar'[Date] = MAX ( 'Axis table'[Datekey] )
)
)
)
)
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope this can provide some ideas on how to create a solution for your data model.
Qty total expected result: =
IF (
SELECTEDVALUE ( 'Axis create'[Required axis] ) = "January",
CALCULATE (
SUM ( Data[Quantity] ),
TREATAS ( VALUES ( 'Axis create'[Key] ), 'Calendar'[End of Month] )
),
CALCULATE (
SUM ( Data[Quantity] ),
TREATAS ( VALUES ( 'Axis create'[Key] ), 'Calendar'[Date] )
)
)
User | Count |
---|---|
25 | |
11 | |
8 | |
7 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
10 | |
6 |