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.
Hello all,
I was trying to create card visuals for the Yearly Gross Revenue, Yearly Net Revenue, Yearly Profit, Yearly Profit Margin, Quarterly Profit, Year-To-Date Profit & Median Sales. However, all of my card visuals are showing (BLANK). Can anyone assist me with my DAX Masures and tell me what I am doing wrong?
Yearly Gross Revenue =
TOTALYTD(
SUM('Sales in USD' [Gross Revenue USD]),
'CalendarTable' [Date]
)
Yearly Net Revenue =
TOTALYTD(
SUM('Sales in USD' [Net Revenue USD]),
'CalendarTable' [Date]
)
Yearly Profit =
SUMX(
‘Sales in USD’,
[Net Revenue USD] - [Total Tax USD]
)
Yearly Profit Margin =
DIVIDE(
[Yearly Profit],
[Yearly Gross Revenue],
0
) * 100
Quarterly Profit =
CALCULATE(
[Yearly Profit],
DATESQTD(‘Calendar’ [Date])
)
YTD Profit =
TOTALYTD(
[Yearly Profit],
‘CalendarTable’[Date]
)
Median Sales =
MEDIANX(
‘Sales in USD’,
[Net Revenue USD]
)
Hi @iHunt ,
Could you tell me if your issue has been solved? If it is, kindly Accept the helpful reply as the solution. More people will benefit from it.
If not, as far as I know, your issue should be caused by your data model.
Here I suggest you to share a sample file with us and show us the screenshot with the result you want.
This will make us to find the solution easier.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @iHunt -Can you please provide sample data, more details about your data model, such as the relationships between your tables and any filters that might be applied, and we can further troubleshoot the issue.
The TOTALYTD function might not be returning expected results if there's an issue with the data or the date table.
Test the measures without TOTALYTD to see if they return any values
Test Gross Revenue = SUM('Sales in USD'[Gross Revenue USD])
Test Net Revenue = SUM('Sales in USD'[Net Revenue USD])
you can calculate the gross revenue using Datesytd
Yearly Gross Revenue =
CALCULATE(
[Test Gross Revenue],
DATESYTD('CalendarTable'[Date])
)
Yearly Net Revenue =
CALCULATE(
[Test Net Revenue],
DATESYTD('CalendarTable'[Date])
)
try for other measures too still issue exist, please share sample data
Proud to be a Super User! | |
User | Count |
---|---|
77 | |
76 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
79 | |
57 | |
48 | |
48 |