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
Hi,
Please review the attached two screenshot and the file.
Screenshot 1.
Here I want to show only 1 row for each source ids which will show status as ACTIVE,Its Subscription Activation date and Last Cancellation date. user have multiple activation and cancellation date but I only want to show latest status = Active and its last cancellation date. I want output as given in screenshot 2. Please scroll down for screenshot 2
Scrrenshot2
I have written a dax function but it is showing me output like in screenshot 1 but I need output as screenshot 2
Please help me for correct dax function.
I am uploading the file, kindly review it
https://drive.google.com/file/d/1DYGnjoSLAa_dJasYNnQU7kSIkqxDS2Mf/view?usp=drivesdk
Solved! Go to Solution.
Hi @UpharAnand
Your table is currently returning multiple rows because there are still unique rows at the status level and subscription number level.
To get to one row at the sourceid level, you need to aggregate all of these columns.
Please create measures like :
The updated PBIX is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
You seemed to be at the right path already. Since you didn't need to include non-active status, you can just filter those rows out and another calculation for the lastest subscription number
Latest Subscription =
VAR MaxSubsDate =
CALCULATE (
MAX ( act_subscription[subscriptionactivateddate] ),
ALLEXCEPT ( act_subscription, act_subscription[sourceid] )
)
RETURN
CALCULATE (
MAX ( act_subscription[subscriptionnumber] ),
FILTER (
ALLEXCEPT ( act_subscription, act_subscription[sourceid] ),
act_subscription[subscriptionactivateddate] = MaxSubsDate
&& act_subscription[status] = "active"
)
)
Proud to be a Super User!
Hi @UpharAnand
Your table is currently returning multiple rows because there are still unique rows at the status level and subscription number level.
To get to one row at the sourceid level, you need to aggregate all of these columns.
Please create measures like :
The updated PBIX is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hi @UpharAnand ,
but I only want to show latest status = Active and its last cancellation date
What if there isi no active status for a source id?
Proud to be a Super User!
Sorry for this confusion. if there is no active status then that source id will not be shown in the visual.
You can also make changes as per your logic.
You seemed to be at the right path already. Since you didn't need to include non-active status, you can just filter those rows out and another calculation for the lastest subscription number
Latest Subscription =
VAR MaxSubsDate =
CALCULATE (
MAX ( act_subscription[subscriptionactivateddate] ),
ALLEXCEPT ( act_subscription, act_subscription[sourceid] )
)
RETURN
CALCULATE (
MAX ( act_subscription[subscriptionnumber] ),
FILTER (
ALLEXCEPT ( act_subscription, act_subscription[sourceid] ),
act_subscription[subscriptionactivateddate] = MaxSubsDate
&& act_subscription[status] = "active"
)
)
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
126 | |
85 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |