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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
alloja
Frequent Visitor

Impossible to determine a unique value for column X1 in table X

Hello,

 

Here is the capture. The message in yellow was displayed as indicated in the object. Is there a solution to this "problem"?

Capture d’écran 2024-07-26 111331.png


Please note that these are What-if parameters: [Tarif/CV <10ans] and [Tarif/CV >=10 ans].

Thanks for your help.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @alloja ,

I create a table and two measures as you mentioned.

vyilongmsft_0-1722235748335.png

 

Tarif/CV <10 ans = 
IF (
    MAX('Global'[barf.etat_vn_vo]) = "VO<10ans",
    100, 
    0
)
Tarif/CV>10 = 
IF (
    MAX('Global'[barf.etat_vn_vo]) = "VO>=10ans" || MAX('Global'[barf.etat_vn_vo])="VN",
    200, 
    0
)

 

vyilongmsft_2-1722236758146.png

Then I put the DAX code into a measure, it gives me the same error.

vyilongmsft_1-1722236246068.png

So I think you can use SUM function or Max function in matrix visual. If you use SWITCH function, it also can give you the correct result.

 

Measure = 
SUMX (
    'Global',
    SWITCH (
        TRUE (),
        'Global'[barf.etat_vn_vo] = "VO<10ans"
            && 'Global'[barf.montant_y1] > 0, 'Global'[barf.puiss_admin] * [Tarif/CV <10 ans],
        'Global'[barf.etat_vn_vo] = "VN"
            && 'Global'[barf.montant_y1] > 0, 'Global'[barf.puiss_admin] * [Tarif/CV <10 ans],
        'Global'[barf.etat_vn_vo] = "VO>=10ans"
            && 'Global'[barf.montant_y1] > 0, 'Global'[barf.puiss_admin] * [Tarif/CV>10],
        0
    )
)

 

vyilongmsft_0-1722237133152.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @alloja ,

I create a table and two measures as you mentioned.

vyilongmsft_0-1722235748335.png

 

Tarif/CV <10 ans = 
IF (
    MAX('Global'[barf.etat_vn_vo]) = "VO<10ans",
    100, 
    0
)
Tarif/CV>10 = 
IF (
    MAX('Global'[barf.etat_vn_vo]) = "VO>=10ans" || MAX('Global'[barf.etat_vn_vo])="VN",
    200, 
    0
)

 

vyilongmsft_2-1722236758146.png

Then I put the DAX code into a measure, it gives me the same error.

vyilongmsft_1-1722236246068.png

So I think you can use SUM function or Max function in matrix visual. If you use SWITCH function, it also can give you the correct result.

 

Measure = 
SUMX (
    'Global',
    SWITCH (
        TRUE (),
        'Global'[barf.etat_vn_vo] = "VO<10ans"
            && 'Global'[barf.montant_y1] > 0, 'Global'[barf.puiss_admin] * [Tarif/CV <10 ans],
        'Global'[barf.etat_vn_vo] = "VN"
            && 'Global'[barf.montant_y1] > 0, 'Global'[barf.puiss_admin] * [Tarif/CV <10 ans],
        'Global'[barf.etat_vn_vo] = "VO>=10ans"
            && 'Global'[barf.montant_y1] > 0, 'Global'[barf.puiss_admin] * [Tarif/CV>10],
        0
    )
)

 

vyilongmsft_0-1722237133152.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

Thank you very much. I saw "SWITCH", but refrained from using it because I didn't understand its use.


Once again, thank you very much.

Best regards,

alloja

mickey64
Super User
Super User

For your reference.

mickey64_0-1722089191547.png

 

Ritaf1983
Super User
Super User

Hi @alloja 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors