Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pravallika_L
Helper I
Helper I

Need Help regarding DAX Formulas for creating Matrix for the mentioned Values

Hi  @tamerj1 @amitchandak @ALLUREAN 

Need help in calculating the below formulas in powerBI :

Data :

Opportunity NameType of ProposalBusiness LineSectorProposal StatusWin ProbabilityStatusStatus ReasonSponsorSponsor TypeSponsor CategoryTotal CostTotal Admin RevenueTotal Program RevenueSurplus/Deficit
KalyaNewApplication/SelectionPrivate SectorNot AwardedHighOpenIn ProgressNagAdvaitEducational InstitutionNULL0.000.000.00NULL
Opportunity31NewApplication/SelectionUSGPending ResponseMedium OpenIn ProgressQA Account4Academic ProgramPartner0.000.000.0033.00
Lead99NewCapacity-building/PartnershipsPrivate SectorAwardedMedium OpenIn ProgressQA Account4Academic ProgramPartner300050150000.00140000.00478
MaheshNewCapacity-building/PartnershipsUSGAwardedMedium OpenIn ProgressMAHLE Engine Components USA, IncCompanyNULL0.000.000.00NULL
@TEST_Venkat_PBINewChildren of Employee ScholarshipsPrivate SectorPending ResponseMedium WonWonTEST AccountNULLNULL5110050100000.005000000.00289
@Venkat_ROI_OpenNewChildren of Employee ScholarshipsPrivate SectorPending ResponseHighOpenIn Progress@Venkat & Co.Educational InstitutionPublic610050100000.00500000.00680
@Venkat_ROI_REPORT_Out SoldNewChildren of Employee ScholarshipsUSGCancelledLowLostOut-Sold@Venkat & Co.Educational InstitutionPublic160050100000.0050000.00600
@Venkat_ROI2_OpenNewChildren of Employee ScholarshipsPrivate SectorAwardedMedium OpenIn ProgressVenkatGovernmentResearch Center/Institute14005030000.00100000.00458
AM_LeadRenewal RebidChildren of Employee ScholarshipsPrivate SectorCancelledHighOpenIn ProgressSala 1 – Centro Internazionale d’Arte ContemporaneaNon-Government OrganizationNULL135050100000.0025000.00NULL
Opportunity with SlateNewChildren of Employee ScholarshipsUSGCancelledHighOpenOn HoldJVN Test InstitutionEducational InstitutionCollege, Higher Ed Institution100500.000.0077.90
@Venkat_PBI_LOWNewDiaspora EngagementPrivate SectorAwardedLowWonWon@Venkat & Co.Educational InstitutionPublic310050100000.00200000.005000.00
VENKAT_ROI_REPORT_CancelledNewDiaspora EngagementPrivate SectorCancelledHighLostCanceled@Venkat & Co.Educational InstitutionPublic252005010000.002500000.004400
@Venkat_Test_Opty BPFNewEducation in EmergenciesUSGAwardedMedium WonWon@Venkat & Co.Educational InstitutionPublic360050100000.00250000.00567
@Venkat_Test Lead_19Dec22Renewal RebidPlacementUSGAwardedHighOpenIn ProgressVenkatGovernmentResearch Center/Institute147317054806666.009914989.0055.66
QA Lead2NewPlacementUSGAwardedMedium OpenIn ProgressQA Account4Academic ProgramPartner0.000.000.00NULL
Ryan Allen New Opp 14NewPlacementUSGPending ResponseHighOpenIn ProgressJVN Test InstitutionEducational InstitutionCollege, Higher Ed Institution0.000.000.00NULL
LeenaNewStudy ToursPrivate SectorPending ResponseMedium OpenIn ProgresshamiltonNULLNULL0.000.000.00NULL
Opportunity_AM1NewTraining/Workforce DevelopmentUSGNot AwardedMedium OpenIn ProgressAdobe AM Participant InstEducational InstitutionNULL0.000.000.004444.00
SusanRenewal RebidTraining/Workforce DevelopmentPrivate SectorPending ResponseHighOpenIn ProgressupEnd MovementCompanyNULL100500.000.00NULL
Test OptyNewTravel and Learning FundUSGNULLMedium OpenIn Progress- Center for Spatial Technologies and Remote SensingNon-Government OrganizationNULL0.000.000.00NULL
Test for emailRenewal RebidVisa SponsorshipPrivate SectorNULLHighOpenIn Progress- Center for Spatial Technologies and Remote SensingNon-Government OrganizationNULL100500.000.00NULL

Formulas : 

Pravallika_L_4-1675354181907.png

 

Output

  Pravallika_L_3-1675354132152.png

Formula 2: 

Pravallika_L_5-1675354219932.png

 

 

output : will be like above table in % but instead of count i need to sum and show them in %

 

Formula which I used till now with the help of tamerj1 

1. Trial_# of Proposals Awarded =

CALCULATE (
    COUNT ( v_dyn_opportunity[Lines_of_Business] ),
    FILTER (
        v_dyn_opportunity,
             v_dyn_opportunity[Proposal_Status] = "Awarded"
    )
)
2. Trial_# of Proposals_WCO =
CALCULATE (
    COUNT ( v_dyn_opportunity[Lines_of_Business] ),
    FILTER (
        v_dyn_opportunity,
        v_dyn_opportunity[Proposal_Status] IN { "Awarded", "Cancelled", "Not Awarded" }
    )
)

3. Trial_# of Proposals_divide =

VAR ProposalsWCO =
    IF (
        ISINSCOPE ( v_dyn_opportunity[Sector] ),
        CALCULATE (
            [Trial_# of Proposals_WCO],
            ALLSELECTED ( v_dyn_opportunity[Lines_of_Business] ),
            ALL ( Lines_of_Business )
        ),
        [Trial_# of Proposals_WCO]
    )
RETURN
    DIVIDE (
        [Trial_# of Proposals Awarded],
        ProposalsWCO
    )
4. Trial_Final Measure =
VAR CurrentBusinessLine = SELECTEDVALUE ( Lines_of_Business[Lines_of_Business] )
VAR NormalValue = [Trial_# of Proposals_divide]
VAR NumOfProposals = CALCULATE ( [Trial_# of Proposals Awarded], ALL ( Lines_of_Business ) )
VAR Result =
    IF (
        CurrentBusinessLine = "# Proposals",
        FORMAT ( NumOfProposals, "#" ),
        NormalValue
    )
RETURN Result
 
and the output i have got by using the above formulas is not exactly the right output shown below :
 
Pravallika_L_6-1675354540941.png
But i also couldn't perform the color coding for individual Columns like for Private Sector one set of color codes and for USG another set of color codes. That too if there are blanks then they must have white background. And also the entire #Proposals row background must be white & should be in bold with font color blue. Exactly the output should be like the one i showed at the start for the first formula. 
The second formula should not have #Proposals in it. 
Can anyone please help me with this. I also have another tables but first i will go with this
 
Thanks in Advance

 

2 REPLIES 2
Pravallika_L
Helper I
Helper I

Hi All,

Got the output like i displayed at the start. I just removed the line ALL ( Lines_of_Business ) from the below formula. But I was not getting the 0% in total and list of business lines which atleast has some Proposals like not awarded, Canceled,... they must also be in the list with a blank value. @tamerj1 can you please help me out. 

3. Trial_# of Proposals_divide =

VAR ProposalsWCO =
    IF (
        ISINSCOPE ( v_dyn_opportunity[Sector] ),
        CALCULATE (
            [Trial_# of Proposals_WCO],
            ALLSELECTED ( v_dyn_opportunity[Lines_of_Business] )
        ),
        [Trial_# of Proposals_WCO]
    )
RETURN
    DIVIDE (
        [Trial_# of Proposals Awarded],
        ProposalsWCO
    )
Pravallika_L
Helper I
Helper I

Can anyone please help me on this.......please..........

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.