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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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!:
Mastering Power BI 2nd Edition

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors