• Zur Hauptnavigation springen
  • Zum Inhalt springen
  • Zur Seitenspalte springen
  • Zur Fußzeile springen

THE SELF-SERVICE-BI BLOG

Wir lieben Microsoft Power BI

  • Videokurse
    • Coming soon!
  • Live Online Power BI-Schulungen
  • Beratung
    • Was ich für Dich tun kann
    • Showcases
  • Kunden
  • BLOG
    • Business Topics
    • Technical Topics (english)
    • Tools
  • Podcast
  • Kontakt
  • Über

Technical Topics (english) / 11. Mai 2018

Passing Filters to a Measure differently in DAX

Hi folks, I came across an unusual syntax for passing filters to a measure differently in DAX and want to share that with you.

Let’s start with following basic measure:

Revenue =
SUM ( FactRevenue[Rev.] )

Using this measure, you could calculate a YTD value by passing the DATESYTD() function to the CALCULATE function like this:

RevenueYTD_conventional =
CALCULATE ( [Revenue]; DATESYTD ( DimCalendar[Date] ) )

But there is another syntax you can use:

RevenueYTD_unconventional =
[Revenue](DATESYTD ( DimCalendar[Date] ) )

This version looks like no CALCULATE is needed, but CALCULATE always is added to a measure call. For this reason the conventional and the unconventional version internally are the same thing.

All my code above was formatted using daxformatter.com. When I tried to format the unconventional version, it automatically got converted into the conventional version. So I had to format it manually. For this reason I am pretty sure, Marco and Alberto have good reason not to use this kind of syntax. Anyway: I found it interesting that it works and wanted to share this observation with you 🙂

Regards from Germany,

Lars

I write my posts for you, the reader. Please take a minute to help me write my posts as well as possible. Thank you 🙂

[yasr_visitor_multiset setid=2]

Lars Schreiber

Lars ist Berater, Entwickler und Trainer für Microsoft Power BI. Er ist zertifizierter Power BI-Experte und Microsoft Trainer. Für sein Engagement in der internationalen Community wurde Lars seit 2017 jährlich durch Microsoft der MVP-Award verliehen. Lies hier mehr…

Kategorie: Technical Topics (english)

Seitenspalte

WEBSITE DURCHSUCHEN

MELDE DICH FÜR DIE POWER BI USER GROUP HAMBURG AN

Trage Deine E-Mailadresse ein, um für kommende Treffen der PUG Hamburg eingeladen zu werden. Zudem erhältst Du Zugriff auf die Materialien der vergangenen Treffen.

Footer

Kontakt

THE SELF-SERVICE-BI BLOG
Mail: lars@ssbi-blog.de

Rechtliches

  • Impressum
  • Datenschutz

Über THE SELF-SERVICE-BI BLOG

Ich bin ein freiberuflicher Power BI-Berater, -Entwickler und -Trainer und wurde von Microsoft mehrfach mit dem MVP Award ausgezeichnet. Ich arbeite mit einem kompetenten Netzwerk aus freiberuflichen und ambitionierten Kollegen zusammen. Erfahre hier mehr.

Social

Folge mir...

Copyright © 2025 · Digital Pro on Genesis Framework