The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi everyone, I'm having some trouble trying to create a total of the revenue from my dataset. I am looking to total the revenue for the slicer selected year and month, and then compare it with the previous year's same month revenue. Here is the DAX query I've run so far -
Solved! Go to Solution.
@Ashish_Mathur Thank you very much for your prompt reply. Allow me to offer a different approach here:
Your code seems to be fine, but if it is not outputting the expected results, then try the following code.
Here's some dummy data
“Append1”
Create measures.
Revenue This Year-Month =
CALCULATE(
SUM('Append1'[qtdamount]),
FILTER('Append1',
'Append1'[scenario] = "Actual"
&&
Append1[rollup_level_4_name]="Revenue"
)
)
Revenue Last Month =
CALCULATE(
SUM('Append1'[qtdamount]),
FILTER(ALL('Append1'),
'Append1'[scenario] = "Actual"
&&
'Append1'[rollup_level_4_name] = "Revenue"
&&
'Append1'[ficalyear] = MAX('Append1'[ficalyear]) - 1
&&
'Append1'[ficalmonth] = MAX('Append1'[ficalmonth])
)
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Ashish_Mathur Thank you very much for your prompt reply. Allow me to offer a different approach here:
Your code seems to be fine, but if it is not outputting the expected results, then try the following code.
Here's some dummy data
“Append1”
Create measures.
Revenue This Year-Month =
CALCULATE(
SUM('Append1'[qtdamount]),
FILTER('Append1',
'Append1'[scenario] = "Actual"
&&
Append1[rollup_level_4_name]="Revenue"
)
)
Revenue Last Month =
CALCULATE(
SUM('Append1'[qtdamount]),
FILTER(ALL('Append1'),
'Append1'[scenario] = "Actual"
&&
'Append1'[rollup_level_4_name] = "Revenue"
&&
'Append1'[ficalyear] = MAX('Append1'[ficalyear]) - 1
&&
'Append1'[ficalmonth] = MAX('Append1'[ficalmonth])
)
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Try this approach
Revenue This Year-Month = CALCULATE(SUM('Append1'[qtdamount]),'Append1'[scenario] = "Actual",Append1[rollup_level_4_name]="Revenue")
Revenue in SPLY = calculate([Reenue this Year-Month],sameperiodlastyear(calendar[date]))
Hope this helps.