The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
hello everyone!
i have created a cohort for (total users who canceled and returned) using a matrix visual as follows:
rows: cancelation month
columns : difference between cancelation month and retention month
values: [total users]
as you can notice the rows represents current month+1
ex. if current month is obtober2021 :
0= obtober2021
1= november2021
2= december2021
and so on
the thing is , when month is after the current month , ex 'December2021 and not reached yet , i want the value to show blank instead of zero and only show zero when month is before current month
Example: if im in october2021, and November2021 value is zero , i want to see 0 for november2021 and Blank for december2021 because it's not reached yet
note that in order to get zeros in the matrix , i had to join with another table that had index column (using generate_series)
because when i used the index column inside my table i couldnt get any zeros and it was only blanks wether its before current month or after
so, what i want to get is : zero when month is before current month and blank if it's after current month
appreaciate the help!
Solved! Go to Solution.
Hi,
According to your description and sample picture, I think you can simply change your DAX formula like this to achieve your needs:
total users =
var _value=
CALCULATE(DISTINCTCOUNT(table[user_id]))
return
if(_value=blank(),0,_value)
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lawada
Can you share a sample of your PBIX file after removing sensetive data?
Or if you use any measure share codes with us?
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
i have used only one measure to count total users :
Hi,
According to your description and sample picture, I think you can simply change your DAX formula like this to achieve your needs:
total users =
var _value=
CALCULATE(DISTINCTCOUNT(table[user_id]))
return
if(_value=blank(),0,_value)
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
25 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |