Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I am having difficulty getting the following to work any help would be appreciated.
IF( MAX(Machine[Display])="Precision"
,CALCULATE(SUM(Manufacturing[TonnesMade]),Machine[Alt Name] IN {"MA","MB","MC","MD"})
,CALCULATE( SUM(Manufacturing[TonnesMade])))
TRIED
VAR = CALCULATE(SUM(Manufacturing[TonnesMade]),Machine[Alt Name] IN {"MA","MB","MC","MD"})
RETURN
IF( MAX(Machine[Display])="Precision"
,VAR
,CALCULATE( SUM(Manufacturing[TonnesMade])))
If I do the following
IF( MAX(Machine[Display])="Precision"
,12345.01
,CALCULATE( SUM(Manufacturing[TonnesMade])))
It returns the 12345.01 for Precision otherwise it wont even show Precision.
All other results are shown as expected for any of the variations I have tried.
The CALCULATE(SUM(Manufacturing[TonnesMade]),Machine[Alt Name] IN {"MA","MB","MC","MD"}) does return a value if i use it in a card as a test
the table Manufacturing and Machine have a relationship one to many.
Solved! Go to Solution.
I changed this
IF( MAX(Machine[Display])="Precision"
,CALCULATE(SUM(Manufacturing[TonnesMade]),Machine[Alt Name] IN {"MA","MB","MC","MD"})
,CALCULATE( SUM(Manufacturing[TonnesMade])))
To
IF( MAX(Machine[Display])="Precision"
,CALCULATE(SUM(Manufacturing[TonnesMade]),Machine[Alt Name] IN {"MA","MB","MC","MD"},
)
,CALCULATE( SUM(Manufacturing[TonnesMade])))
It now works as I required.
I will be the first to acknowledge I have no idea what the allexcept is acually doing.
Thanks for looking at this for me.
@David01 , can share some visual screen shot. the above should work
Try this too
CALCULATE(SUM(Manufacturing[TonnesMade]),Filter(Machine, Machine[Alt Name] IN {"MA","MB","MC","MD"}) )
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
I changed this
IF( MAX(Machine[Display])="Precision"
,CALCULATE(SUM(Manufacturing[TonnesMade]),Machine[Alt Name] IN {"MA","MB","MC","MD"})
,CALCULATE( SUM(Manufacturing[TonnesMade])))
To
IF( MAX(Machine[Display])="Precision"
,CALCULATE(SUM(Manufacturing[TonnesMade]),Machine[Alt Name] IN {"MA","MB","MC","MD"},
)
,CALCULATE( SUM(Manufacturing[TonnesMade])))
It now works as I required.
I will be the first to acknowledge I have no idea what the allexcept is acually doing.
Thanks for looking at this for me.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
69 | |
35 | |
21 | |
18 | |
15 |
User | Count |
---|---|
127 | |
32 | |
27 | |
24 | |
22 |