flag
4 TopicsDAX for evaluating flags in large table
I have a dashboard with the following limitations: Over 40 million rows in the main fact table. The dashboard compares two time periods that are selected by the user. The time periods are internally defined (not dates) and are selected by the user using two slicers. There is some "same store" logic which requires the use of an IF statement in the majority of measures. Other measures are built on top of these base measures. This approach uses a pre-calculated pattern of time periods assigned to each store and joined to the main fact table. Example measure: measure_1 = VAR PeriodSelection = SELECTEDVALUE( same_store_filter[Value] ) VAR Result = IF( PeriodSelection = "All Stores", CALCULATE ( SUM( fact_performancesummary[unitcapacitycnt] ), fact_performancesummary[resettimingdesc] IN VALUES ( compare_case_1[resettimingdesc] ) ), CALCULATE ( SUM( fact_performancesummary[unitcapacitycnt] ), fact_performancesummary[resettimingdesc] in VALUES(compare_case_1[resettimingdesc]), dim_same_store_status[resettimingdesc_2] in VALUES(compare_case_2[resettimingdesc]) ) ) RETURN Result Problem: One of the tabs on the dashboard is essentially a large, very granular data dump with a calculation that compare values for the two time periods and evaluates them as "Added" (new products), "Deleted" (removed products), or "Maintained" (products in both time periods). If I use an IF or SWITCH statement for this secondary evaluation, the visual chokes on anything over a few thousand rows. However, if I use a DIVIDE statement with the two values, I can create a conditionally formatted icon that displays close to 500K rows. (The conditional formatting is based on the three states resulting from the DIVIDE: 1) a positive number; 2) a negative #1 (the error default), and 3) blank or zero. The user wants to be able to export an actual text flag but the conditional formatting just downloads as the underlying numeric results. Example: _flag = DIVIDE([measure_1],[measure_2],-1) Conditional Formatting: Visual: I'm looking for ways to efficiently display a text-based flag that the user can export.Solved961Views0likes4CommentsUrgent Help with Creating a Flag column
Problem: Please, I am trying to check if my recent admission location is the same as my recent discharge location and create a flag to help me with my other measures. How to approach this. check... 1. The patient's most recent admission location 2. The patient's most recent discharge location 3. Create a flag to see if they have the same location then 1, else 0 Table: patient_name patient_Id admission_date discharge_date record_Id Location Mark 1 1/1/2018 3/15/2019 1001 A John 2 6/1/2019 6/3/2020 1002 B Tom 3 1/1/2020 8/7/2020 1003 A Tom 3 8/7/2020 9/7/2020 1004 C Tom 3 9/7/2020 10/3/2020 1005 A Sarah 4 7/2/2015 2/1/2018 1006 C Kim 5 3/1/2016 7/6/2017 1007 E Mark 1 3/16/2019 4/7/2019 1008 A Tom 3 2/1/2021 1009 C Steve 6 3/2/2019 1010 John 2 3/4/2022 5/10/2022 1011 A Expected Results: patient_name patient_Id location_flag //Explanation Mark 1 1 most recent discharge location and new admission location is the same so flag is 1 John 2 1 recent discharge location is same as recent admission Tom 3 0 different locations for their recent admission and discharge record Sarah 4 0 has only one record Kim 5 0 has only one record Steve 6 0 has only one record, no discharge record Thank you very much in advance.Solved875Views0likes2CommentsFirst occurrence in a measure
Hi folks, I've been scratching my head over this issue and read through multiple forum posts but nothing has helped me so far. Sample data below: I have four fields here: Index - unsummarized column from my source (column) Wafer Sum = Summarized column Cumulative Sum = Running total of Wafer Sum per Index column (Quick Measure) Flag = Toggles between Yes and No based on following condition ( [Cumulative Sum] >= [Wafer Sum] * 0.5) (Measure) What I'm trying to accomplish is get the first occurrence when the Flag = "Yes" and return the Index value. In this case, the Index value returned should be 25. However, I cant use most of the functions such as EARLIER, MINX or CALCULATE since they are catered towards columns and not measures. Any help on this issue is appreciated. Thanks in advance!Solved3.1KViews0likes4CommentsCreate a Flag calculated Column for MyCompany clients
Hello Everyone I need to create a Calculated Column to flag my company's clients. Algorithm is simple but tricky: If a Client only has MyCompany as provider it should be marked as ExclusiveClient If a Client has MyCompany and any other company as providers should me marked as SharedClient Finally if the client doesnt have MyCompany as provider it should be marked as NotMyClient ClientId Provider Flag Jhon MyCompany SharedClient Jhon Provider02 SharedClient Jhon Provider17 SharedClient Luis Provider11 NotMyClient Luis Provider03 NotMyClient Carlos MyCompany ExclusiveClient Pedro Provider16 SharedClient Pedro MyCompany SharedClient Last but not least, I cant use row count because we have the same information for all months of the year in the same table Any suggestions about how to create the Calculated Column. Rewards.Solved2.3KViews0likes4Comments