Forum Discussion

Karolina411's avatar
Karolina411
Helper V
1 year ago

Filtering on 3 Parameter in Paginated reports

 

 

I am working on a Paginated report that the user would like to

  • Select date (Month/Year) then the Physician organization then the pcp location to have a pdf for that location only. Below the Physician Organization does not filter on the PCP Location.
  • Dataset1 will be filtered by Physician Organization, PCPlocation  and Date (monthly reporting) and Physician Location which has the  Physician Organization & PCPlocation values which the Parameters connect to. Below is what the report data looks like and I added the DAX fields below (this is from a CUBE or Tabular connection)  I am thinking I should put the Year and Month in the PCpOrganization table?

 

 

 

 

EVALUATE

VAR FilteredTable =

    SUMMARIZECOLUMNS(

        'Providers'[PCPLocation],

        'Providers'[PhysicianOrganization],

        'Patients'[InsuranceType],

        'DateDim'[Year],

        'DateDim'[MonthNameAbbreviation],

       

        FILTER(

            VALUES('Patients'[Populations]),

            'Patients'[Populations] = "GM"

        ),

FILTER(

            VALUES('DateDim'[Year]),

            'DateDim'[Year] = VALUE(@Year)

        ),

       

        FILTER(

            VALUES('DateDim'[MonthNameAbbreviation]),

            'DateDim'[MonthNameAbbreviation] = @Month

        ),

                                FILTER(

        VALUES('Providers'[PCPLocation]),

       'Providers'[PCPLocation] = @PCPLocation

    ),

                FILTER(

            VALUES('Providers'[PhysicianOrganization]),

            'Providers'[PhysicianOrganization] = @PhysicianOrganization

        ),

                                FILTER(

        VALUES('Payment'),

        'Payment'[PaymentType] = "Allowed"

    ),

FILTER(VALUES('Providers'[HFPN_GMCC_Flag]), ('Providers'[HFPN_GMCC_Flag] = "Yes")),

 FILTER(VALUES('Outpatient'[OfficeVisitEncounter]), ('Outpatient'[OfficeVisitEncounter] = "Virtual Visit")),

        "UniquePatients", [UniquePatients],

        "TotalCostYTD", [TotalCostYTD],

        "MemberMonthsYTD", [MemberMonthsYTD],

        "Admits1000YTD", [Admits1000YTD],

"AnnualWellnessExamNumerator",[AnnualWellnessExamNumerator],"AnnualWellnessExamDenominator",[AnnualWellnessExamDenominator], "AnnualWellnessExamRate",[AnnualWellnessExamRate],

   "AntidepressantMedicationAcutePhaseNumerator",[AntidepressantMedicationAcutePhaseNumerator],"AntidepressantMedicationAcutePhaseDenominator", [AntidepressantMedicationAcutePhaseDenominator],

"AntidepressantMedicationAcutePhaseRate", [AntidepressantMedicationAcutePhaseRate],

"ERVisitsYTD", [ERVisitsYTD],

        "ERVisits1000YTD", [ERVisits1000YTD],

        "BloodPressureNumerator", [BloodPressureNumerator],

        "BloodPressureDenominator", [BloodPressureDenominator],

        "BloodPressureRate", [BloodPressureRate],

"DAWNumerator",[DAWNumerator], "DAWDenominator",[DAWDenominator], "DAWFillRate",[DAWFillRate],

        "DiabetesHbA1cLessThan8Numerator", [DiabetesHbA1cLessThan8Numerator],

        "DiabetesDenominator", [DiabetesDenominator],

        "DiabetesHbA1cLessThan8Rate", [DiabetesHbA1cLessThan8Rate],

        "ReadmitsYTD", [ReadmitsYTD],

        "ReadmitsYTDRate", [ReadmitsYTD%],

        "AdmitsYTD", [AdmitsYTD],

        "AllowedCost", [AllowedCost],

        "AllowedCostYTD", [AllowedCostYTD],

        "AllowedPMPMYTD", [AllowedPMPMYTD],

        "BreastCancerScreeningNumerator", [BreastCancerScreeningNumerator],

        "BreastCancerScreeningDenominator", [BreastCancerScreeningDenominator],

        "BreastCancerScreeningRate", [BreastCancerScreeningRate],

        "ColorectalCancerScreeningDenominator", [ColorectalCancerScreeningDenominator],

        "ColorectalCancerScreeningNumerator", [ColorectalCancerScreeningNumerator],

        "ColorectalCancerScreeningRate", [ColorectalCancerScreeningRate],

        "ERVisitsRate", [ERVisitsYTDMoreThan5Visits1000],

        "ERVisitsNumerator", [ERVisitsYTDMoreThan5Visits],

        "VirtualNumerator", [OutpatientUtilYTD],

        "VirtualRate", [OutpatientUtil1000YTD],

        "DepressionScreeningNumerator", [DepressionScreeningNumerator],

        "DepressionScreeningDenominator", [DepressionScreeningDenominator],

        "DepressionScreeningRate", [DepressionScreeningRate],

        "DepressionPositiveScreenNumerator", [DepressionPositiveScreenNumerator],

        "DepressionPositiveScreenDenominator", [DepressionPositiveScreenDenominator],

        "DepressionPositiveScreenRate", [DepressionPositiveScreenRate],

        "CervicalCancerNumerator", [CervicalCancerNumerator],

        "CervicalCancerDenominator", [CervicalCancerDenominator],

        "CervicalCancerRate", [CervicalCancerRate],

        "GenericNumeratorYTD", [GenericNumeratorYTD],

        "GenericDenominatorYTD", [GenericDenominatorYTD],

        "GenericFillRateYTD", [GenericFillRateYTD],

"LowBackPainImaging18to64Numerator",[LowBackPainImaging18to64Numerator],

"LowBackPainImaging18to64Denominator",[LowBackPainImaging18to64Denominator],"LowBackPainImaging18to64InverseRate",[LowBackPainImaging18to64InverseRate],

        "September 2023 YTD", "September 2023 YTD",

        "Zero", 0

    )

   

VAR FilteredResult =

    FILTER(

        FilteredTable,

        [UniquePatients] <> 0

    )

   

RETURN

    FilteredResult

 

EVALUATE

DISTINCT(

    SUMMARIZECOLUMNS(

      

        'Providers'[PhysicianOrganization],

'Providers'[PCPLocation]

    )

)

 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,Karolina411 .I am glad to help you.

    According to your description, you are connecting a semantic model and querying the dataset using DAX code.

    Your query:
    Should I put the Year and Month fields in the PCPOrganization table?
    Here is my suggestion.
    For the DAX Query writing side
    If the Year and Month fields are in the PCPOrganization table, it will be easier to filter the data because all the relevant filters are in the same table and it will make your DAX query writing easier (directly referencing the fields in the PCPOrganization table).

    For data modeling
    Putting the Year and Month fields in the PCPOrganization table simplifies the data model design and makes parameter filtering more intuitive and efficient.
    Doing so also reduces the complexity of cross-table queries and improves query performance.

    First question: With your current dax code, it seems that the existing parameters are not filtering the target results correctly.
    My suggestion is to try to change the filtering order of the parameters and check the filters condition in DAX to make sure that the filtering range is correct for each variable.
    Could you please try to do this using Dax Query Viusal in Power BI Desktop (open the relevant pbix file for this semantic model)

    It's much easier to troubleshoot the code here and you can easily see the syntax errors, so you can try exporting each variable/filter table in the overall DAX code separately to see if it meets your expectations.


    I think it's a good idea to have an additional dataset dedicated to these three parameters, which has a few advantages
    Parameter Independence: Each parameter has its own dataset, which ensures the independence and accuracy of the parameter values.
    Simplified filtering logic: with separate datasets, it's easier to manage and apply parameter filtering logic and avoid complex cross-table queries. Improve performance:
    Setting up separate datasets at the same time can reduce the dependency between datasets and improve the query performance and the speed of generating paged reports.

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Carson Jian,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.