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.
Hi all,
i want to calucaluate the previous month count using below exp not working fine
my Date field is Calendar_date and values are 01-Apr-20 like that
this is my DB view ,. Vw_fact_AIS_9R_SPECIFIC_SHIPMENT_REPORT
Solved! Go to Solution.
Hello,
I am pretty sure that it only works with a dimension date table, so using this table your expression would be like the following:
Prev Month count = CALCULATE([SKU_Count],dateadd(dim_date[.Calendar_date],-1,MONTH))
@Anonymous , not sure the name of date in date table, one of the following
CALCULATE([SKU_Count],dateadd(dim_date[Calendar_date],-1,MONTH))
CALCULATE([SKU_Count],dateadd(dim_date[Date],-1,MONTH))
CALCULATE([SKU_Count],DATESMTD(dateadd(dim_date[Date],-1,MONTH)))
@Anonymous , Use Date calendar
Prev Month count = CALCULATE([SKU_Count],dateadd(Date[Date],-1,MONTH))
MTD Sales = CALCULATE([SKU_Count],DATESMTD('Date'[Date]))
Last month= CALCULATE([SKU_Count],previousmonth('Date'[Date]))
last MTD Sales = CALCULATE([SKU_Count],DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales = CALCULATE([SKU_Count],DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
Appreciate your Kudos.
m getting below error.
Hello,
I am pretty sure that it only works with a dimension date table, so using this table your expression would be like the following:
Prev Month count = CALCULATE([SKU_Count],dateadd(dim_date[.Calendar_date],-1,MONTH))
thnk you . i dont have dim table i have only one main table
how to modify the exp?
CALCULATE([SKU_Count],dateadd(dim_date[.Calendar_date],-1,MONTH))
@Anonymous , not sure the name of date in date table, one of the following
CALCULATE([SKU_Count],dateadd(dim_date[Calendar_date],-1,MONTH))
CALCULATE([SKU_Count],dateadd(dim_date[Date],-1,MONTH))
CALCULATE([SKU_Count],DATESMTD(dateadd(dim_date[Date],-1,MONTH)))
Hi
i dont have date table ..
i have only main table.
@Anonymous - See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |