Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hey All
I am trying to create a Table like below
Now the data set i have has contracts with their Current Segment and Previous Quarter Segment in the Data as written in the final segment column. As such I want have this simple table setup where I can use a seperate table where I ensure all these segments are already set up and then do a count if for current quarter on the current segment column and previous quarter on the previous quarter segment.
Looking online i cant for the life of me find something that will do this or just a simple count if function in Power BI
Solved! Go to Solution.
Hi @Anonymous
Thanks for sharing.
Can you create an extra table for the Segment Status? You can use the "Enter Data" feature in the ribbon. Make sure the spelling is correct as we need them to match with what is in the last two columns of your table.
Go to the Model View and create a one to many relationship from the DIM Segment Table, Segment Column to the Final_Segment column of your table. Do the same for the Previous_Quarter_Final_Segment, this will be an inactive relationship.
Create two measures
Final Segment =
CALCULATE(
DISTINCTCOUNT('Table'[Contract ID]),
KEEPFILTERS('Table'[Final_Segment] <> BLANK())
)
Previous Quarter Segment =
CALCULATE(
DISTINCTCOUNT('Table'[Contract ID]),
KEEPFILTERS('Table'[Previous_Quarter_Final_Segment] <> BLANK()),
USERELATIONSHIP('DIM Segments'[Segment], 'Table'[Previous_Quarter_Final_Segment]
))
Create a table visual and add the Segment column from the DIM Segment table, then add both measures above
Hope this helps
Joe
Proud to be a Super User! | |
Date tables help! Learn more
Hi @Anonymous
Can you share a snaphot of the table? Especiallythe column names and just put some fake data in in one row. I'll see if I can help
Joe
Proud to be a Super User! | |
Date tables help! Learn more
@Joe_Barry here is what the the data would look like in the underlying table:
Contract ID | Final_Segment | Previous_Quarter_Final_Segment |
XXXXXXX | ||
XXXXXXX | 4 – Low Risk | 4 – Low Risk |
Hi @Anonymous
Thanks for sharing.
Can you create an extra table for the Segment Status? You can use the "Enter Data" feature in the ribbon. Make sure the spelling is correct as we need them to match with what is in the last two columns of your table.
Go to the Model View and create a one to many relationship from the DIM Segment Table, Segment Column to the Final_Segment column of your table. Do the same for the Previous_Quarter_Final_Segment, this will be an inactive relationship.
Create two measures
Final Segment =
CALCULATE(
DISTINCTCOUNT('Table'[Contract ID]),
KEEPFILTERS('Table'[Final_Segment] <> BLANK())
)
Previous Quarter Segment =
CALCULATE(
DISTINCTCOUNT('Table'[Contract ID]),
KEEPFILTERS('Table'[Previous_Quarter_Final_Segment] <> BLANK()),
USERELATIONSHIP('DIM Segments'[Segment], 'Table'[Previous_Quarter_Final_Segment]
))
Create a table visual and add the Segment column from the DIM Segment table, then add both measures above
Hope this helps
Joe
Proud to be a Super User! | |
Date tables help! Learn more
Absolute Legend works perfectly!!!
User | Count |
---|---|
117 | |
74 | |
62 | |
50 | |
45 |
User | Count |
---|---|
174 | |
125 | |
60 | |
60 | |
57 |