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 community,
I've 2 KPI cards; one shows the unique user count for the current month based on the filter selected (the slicer right now is a month number), the second KPI shows last months unique user count, this is also based on the filter selected.
Measure I've created is-
LM_User_Count = calculate(countdistinct(User_Id), Table[MonthNo] = selectedvalue(Table[MonthNo]) -1)
This measure does give me the correct number but I am limited to putting a numerical value in my slicer, I want that to be a short form of month, which is there in the table in column MonthName.
Highly appreciate any help! Thank you
Solved! Go to Solution.
Hi @Anonymous
If you want to get the short form of month and put it into slicer, you can add a calculated column with short form of month in your initial table, then put it into slicer,
MonthName = FORMAT('Table'[date],"mmm")
LM_User_Count = calculate(countdistinct(User_Id), Table[MonthNo] = selectedvalue(Table[MonthNo]) -1)
then try your measure again.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
If you want to get the short form of month and put it into slicer, you can add a calculated column with short form of month in your initial table, then put it into slicer,
MonthName = FORMAT('Table'[date],"mmm")
LM_User_Count = calculate(countdistinct(User_Id), Table[MonthNo] = selectedvalue(Table[MonthNo]) -1)
then try your measure again.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , if you have date use date table and time intelligence or create date using month year and use it.
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
Hi Amit, thanks for the prompt reply, I tried using this it doesnt work. I created a date table, but if I try creating a relation between the date table and my base table, the date column goes for toss and if I dont connect and still use the same measure as suggested above, the -1 logic doesnt work
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 | |
98 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |