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
Syndicate_Admin
Administrator
Administrator

Los operadores de comparación de Dax no admiten la comparación de valores de tipo entero con valores de true/false

Estoy tratando de calcular una medida donde tiene cálculos separados para el viernes y el domingo usando Switch. Estoy usando weekday() para separar los viernes y domingos. Pero, está lanzando el error mencionado anteriormente.

latee.PNGlate2.PNG

1 ACCEPTED SOLUTION

Sustitución de "<> OR(5,7)" por " <> 5 ? 7" ha resuelto el problema

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@ziyabikram96 , parece que en algún lugar int está siendo comparado con el texto

Para cosas relacionadas con la fecha de trabajo, compruebe si este blog -https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calenda...

o video

https://youtu.be/58ps6QhXL30

puede ayudar a

Sustitución de "<> OR(5,7)" por " <> 5 ? 7" ha resuelto el problema

Greg_Deckler
Super User
Super User

@ziyabikram96 - Es difícil leer su DAX, ¿podría pegar como texto y reemplazar las cosas que no desea que veamos con marcadores de posición / diferentes nombres? He visto esto suceder si realmente es cierto para comparar un entero con un booleano, pero también lo he visto cuando hay algún tipo de defecto en DAX/lógica. Pero.muy difícil de leer.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

SWITCH(TRUE(),
WEEKDAY(DISTINCT('SourceSheet'[Date]),2) <> OR(5,7), DATEDIFF(DISTINCT('SourceSheet'[In]), DISTINCT('SourceSheet(PAK)'[On Duty]),MINUTE),
WEEKDAY(DISTINCT('SourceSheet'[Date]),2) á 5,CALCULATE(DATEDIFF(DISTINCT('SourceSheet'[In]), TIME(14,00,00),MINUTE),'SourceSheet(PAK)'[Dept] á "abc"),
WEEKDAY(DISTINCT('SourceSheet('[Date]),2) á 7,CALCULATE(DATEDIFF(DISTINCT('SourceSheet'[In]), TIME(16,00,00),MINUTE),'SourceSheet(PAK)'[Dept] á "abc"))
[In] y [On Duty] son columnas de tiempo. He intentado usar Value() con 5,7 y OR(5,7) pero no hay progreso

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.