Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm working with a dataset in DAX where I encounter repeating values labeled as "nominal" and "opening" for each combination of date and wonumber. My objective is to sum the quantities for each date and wonumber. However, I need to adjust this sum by considering only one occurrence of either "nominal" or "opening" in each date and wonumber combination.
Could someone assist me with the DAX formula needed to sum the quantities per date and wonumber, and then divide this sum by the count of unique occurrences of "nominal" and "opening" for each date and wonumber combination?
Example illustrating the shape of the data and the calculation :
Any help would be greatly appreciated!
Solved! Go to Solution.
Hi @Lazurens ,
I created a sample pbix file(see the attachment), please check if that is what you want.
Result =
VAR _tab =
SUMMARIZE (
'Table',
'Table'[Date production],
'Table'[Wnum],
'Table'[Nominal],
'Table'[Opening],
"@sumofqty", SUM ( 'Table'[Quantity] )
)
VAR _qty =
SUMX ( _tab, [@sumofqty] )
VAR _nominal =
MAXX ( _tab, [Nominal] )
VAR _opening =
MAXX ( _tab, [Opening] )
RETURN
_qty / DIVIDE ( _opening, 3600 ) * _nominal
Best Regards
Hi @Lazurens ,
I created a sample pbix file(see the attachment), please check if that is what you want.
Result =
VAR _tab =
SUMMARIZE (
'Table',
'Table'[Date production],
'Table'[Wnum],
'Table'[Nominal],
'Table'[Opening],
"@sumofqty", SUM ( 'Table'[Quantity] )
)
VAR _qty =
SUMX ( _tab, [@sumofqty] )
VAR _nominal =
MAXX ( _tab, [Nominal] )
VAR _opening =
MAXX ( _tab, [Opening] )
RETURN
_qty / DIVIDE ( _opening, 3600 ) * _nominal
Best Regards
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
6 |