Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hello everyone,
I'm having a very difficult time understanding this problem:
first, I created a measure to calculate the Revenue of previous month and wanted to put this in a Card Visual. It returned BLANK. Here's the measure I used for it:
Test Revenue = CALCULATE(
SUM('Table'[Revenue]), PREVIOUSMONTH('Calendar'[Date])
)
When I put it in a table with a date column, it worked, but no total (hence the BLANK in Card Visual)
After searching the internet, I found this site explaining perfectly:
https://forum.enterprisedna.co/t/mtd-value-is-showing-blank-in-card/19858/2
So now my Test Revenue measure is:
test Revenue =
When I used it, I got BLANK as well. Then I removed the PREVIOUSMMONTH filter from the calculation, and it returned a value. However, this is what it returned (in the table below). The test Revenue is the measure and the revenue is simply the column from the original table.
And I'm just lost why would the test Revenue show 24,22 + only one of 5,09 and not the 3 of them. Becaus eof the Summarize?
I'm really lost at his point, so I'd be happy about any explanation. Thank you in advance.
Solved! Go to Solution.
Hi @S3
Because you are summarizing by the same column that you are summing. This summary table will contain only 3 rows: 24.22 ; 5.09 ; 0.00 and those are the numbers that need to be summed.
you can use
test Revenue =
SUMX (
VALUES ( 'Calendar'[Month] ),
CALCULATE (
SUM ( 'Daily Countries'[actual_revenue] ),
PREVIOUSMONTH ( 'Calendar'[Date] )
)
)
You may try
test Revenue =
SUMX (
LASTNONBLANK ( 'Dates'[Monthid], SUM ( 'Daily Countries'[revenue] ) ),
CALCULATE (
SUM ( 'Daily Countries'[revenue] ),
PREVIOUSMONTH ( 'Dates'[Date] )
)
)
Hi @S3
Because you are summarizing by the same column that you are summing. This summary table will contain only 3 rows: 24.22 ; 5.09 ; 0.00 and those are the numbers that need to be summed.
you can use
test Revenue =
SUMX (
VALUES ( 'Calendar'[Month] ),
CALCULATE (
SUM ( 'Daily Countries'[actual_revenue] ),
PREVIOUSMONTH ( 'Calendar'[Date] )
)
)
Hello again 🙂
I have a question regarding this measure please: when I put it in the table, it shows the previous month perfectly, but I now would like to put it in a card and it gives me the total of course.
I tried another previous month measure, which works on the card visual showing previous month, but doesn't change when I filter out months. It also doesn't show row by row when put in a table.
The image below explains everyting. Ideally, I would like your measure (test revenue) to act like my measure of Revenue This Month: shoing row by row and at the end showing only for this month (in the test revenue case, only for past month)
Here is the measure I have for Revenue This Month:
I really appreciate the help!
You may try
test Revenue =
SUMX (
LASTNONBLANK ( 'Dates'[Monthid], SUM ( 'Daily Countries'[revenue] ) ),
CALCULATE (
SUM ( 'Daily Countries'[revenue] ),
PREVIOUSMONTH ( 'Dates'[Date] )
)
)
It works, thank you so much!
thank youu
User | Count |
---|---|
30 | |
18 | |
15 | |
14 | |
10 |