March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello All,
I have a very flat table
Product -------- Month
A ---------------- JAN
B ---------------- JAN
B ---------------- FEB
D ---------------- JAN
A ---------------- JAN
A ---------------- APR
E ---------------- JAN
How can I found out the count of products, which were sold in previous month but not is follwing month
Product A sold in Jan but not in FEB so I want COUNT of
A = 2 in JAN (becauae A was not sold in Feb but sold twice in Jan)
Do not Show B becaue it was sold in both months
I'll apprecite your help.
Solved! Go to Solution.
HI @Anonymous
You could try this calculated table
Table 2 = VAR T1 = ADDCOLUMNS('Table',"MonthAsDateTime", DATEVALUE('Table'[Month] & "-2018")) VAR LeftTable = SELECTCOLUMNS(T1,"Product",[Product],"MonthAsDateTime",[MonthAsDateTime]) VAR RightTable = SELECTCOLUMNS(T1,"Product",[Product],"MonthAsDateTime",EDATE([MonthAsDateTime],-1)) VAR Exceptions = EXCEPT(LeftTable,RightTable) RETURN GROUPBY(Exceptions,[Product],[MonthAsDateTime],"C", SUMX(CURRENTGROUP(),1))
HI @Anonymous
You could try this calculated table
Table 2 = VAR T1 = ADDCOLUMNS('Table',"MonthAsDateTime", DATEVALUE('Table'[Month] & "-2018")) VAR LeftTable = SELECTCOLUMNS(T1,"Product",[Product],"MonthAsDateTime",[MonthAsDateTime]) VAR RightTable = SELECTCOLUMNS(T1,"Product",[Product],"MonthAsDateTime",EDATE([MonthAsDateTime],-1)) VAR Exceptions = EXCEPT(LeftTable,RightTable) RETURN GROUPBY(Exceptions,[Product],[MonthAsDateTime],"C", SUMX(CURRENTGROUP(),1))
Awsome you are the man!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |