Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
HELLO,
I want to create a DAX formula that will calculate the total UNIQUE products by Month and Availabilty using the table below.
So one formula will calculate total unique products for Online and this should give a value of 5 and for Instore it should give a value of 6.
I started by using the CALCULATE Function below but I don't know how to factor in finding the unique products by month:
Total Unique Products for Online = CALCULATE(DISTINCTCOUNT(Products[Product ID]),Products[Availability]="Online",
Please can someone kindly help me out with this.
Thanks in Advance!
Solved! Go to Solution.
@JRA21_13_19_25 Try:
Measure =
VAR __Table = SELECTCOLUMNS('Table',"Month",[Month],"Product ID",[Product ID],"Availability",[Availability])
RETURN
COUNTROWS(DISTINCT(__Table))
This seems like a good situation for SUMMARIZE.
Measure1 =
COUNTROWS (
SUMMARIZE ( Table1, Table1[Month], Table1[Product ID], Table1[Availability] )
)
@JRA21_13_19_25 Try:
Measure =
VAR __Table = SELECTCOLUMNS('Table',"Month",[Month],"Product ID",[Product ID],"Availability",[Availability])
RETURN
COUNTROWS(DISTINCT(__Table))
User | Count |
---|---|
57 | |
21 | |
19 | |
16 | |
16 |
User | Count |
---|---|
87 | |
77 | |
52 | |
37 | |
21 |