Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Getting the error 'An Argument of Function Date has wrong data type or result is too small or too large' when the following measure is included in any graph. However, the Value is shown properly working in KPI cards.
For me solution didn't work out . The problem happened because my Calendar Table didnt have every possible dates from the fact tables . So I had 2 solutions to this problem : 1) filter Calendar[Date] is not blank()
2) Fix Dates of Calendar
@shivakoriginja , I do see anything wrong in formula. Buy as year is keyword too. Rename the year variable as _year and use that
Sales TY = var a = DATE(YEAR(MAX(VW_Primary_Sales_Transaction[BillingDocDate])),MONTH(MAX(VW_Primary_Sales_Transaction[BillingDocDate])),1)
var b = DATE(YEAR(MAX(VW_Primary_Sales_Transaction[BillingDocDate])),MONTH(MAX(VW_Primary_Sales_Transaction[BillingDocDate])),DAY(MAX(VW_Primary_Sales_Transaction[BillingDocDate])))
var _year= IF(MONTH(TODAY()) in {1,2,3},YEAR(TODAY())-1,YEAR(TODAY()))
var cd = DATE(_year,4,1)
var c=DATE(YEAR(MAX(VW_Primary_Sales_Transaction[BillingDocDate])),1,1)
var mtd_value = CALCULATE(SUM(VW_Primary_Sales_Transaction[NetValue])/100000,FILTER(Date_Dimention,Date_Dimention[Date]>=a &&Date_Dimention[Date]<=b)
)
var ytd_value = CALCULATE(SUM(VW_Primary_Sales_Transaction[NetValue])/100000,FILTER(Date_Dimention,Date_Dimention[Date]>=c && Date_Dimention[Date]<=b)
)
var mtd_volume = CALCULATE(SUM(VW_Primary_Sales_Transaction[BillQuantityInAH]),FILTER(Date_Dimention,Date_Dimention[Date]>=a && Date_Dimention[Date]<=b)
)
var ytd_volume = CALCULATE(SUM(VW_Primary_Sales_Transaction[BillQuantityInAH]),FILTER(Date_Dimention,Date_Dimention[Date]>=c && Date_Dimention[Date]<=b)
)
var res =
IF(SELECTEDVALUE(MTDYTD[Name])="MTD" && SELECTEDVALUE(ValueV[Name])="Value",mtd_value,
IF(SELECTEDVALUE(MTDYTD[Name])="MTD" && SELECTEDVALUE(ValueV[Name])="Volume",mtd_volume,
IF(SELECTEDVALUE(MTDYTD[Name])="YTD" && SELECTEDVALUE(ValueV[Name])="Value",ytd_value,
IF(SELECTEDVALUE(MTDYTD[Name])="YTD" && SELECTEDVALUE(ValueV[Name])="Volume",ytd_volume))))
@shivakoriginja , Do see any error in that. Just make sure you have click outside the measure box after saving the changes
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |